You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

php error

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

0
b/Web publicado por u/Jokeriske March 27, 2016, 07:07:10 PM
hey, im getting this error when i try to list all files in a dir and make them clickable and redirect it to the file wich is clicked.

this is the error : Parse error: syntax error, unexpected ''>'' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';' in /var/www/html/admin/uploads/index.php on line 17

this is the code im using :



$files=glob("*.{png,jpg,gif,mp3,mp4}",GLOB_BRACE);
$fileCount = count($files);

for ($i = ($fileCount-1); $i >= 0; $i--) { 
    echo '<center><a href='.$files'>'.$files'<img src='.$files[$i].' id="rcorners2" alt="" width="200px"></center></a>';
echo '</br>';
echo '</br>';
echo '</br>';
}


page_end();
?>


im noob in php i know, ive tried to google and understand the basics for php but this is a little bit above my level :/
Inicia sesión o crea una cuenta para dejar un comentario
u/Jokeriske March 27, 2016, 07:48:33 PM
Problem solved, please lock this :)
u/Dream of Omnimaga March 27, 2016, 08:44:09 PM
What was the issue, by the way? Also @Juju once made an image gallery for img.codewalr.us but he lost the code. He could probably have helped you as well. Or are you trying to make an avatar that changes every page load? I'm not familiar with PHP so I can't really understand most of the code.
u/Yuki March 27, 2016, 08:58:49 PM
Please tell how you solved it, so others can see what was wrong.
u/Jokeriske March 28, 2016, 03:35:49 PM
i used
echo '<center><a href='.$files'>'.$files'<img src='.$files[$i].' id="rcorners2" alt="" width="200px"></center></a>';

instead of
echo '<center><a href='.$files[$i].'><img src='.$files[$i].' id="rcorners2" alt="" width="200px"></center></a>';
u/Dream of Omnimaga March 28, 2016, 08:02:16 PM
I see. I noticed that PHP can be picky when I did some SMF theme editing. X.x
u/Jokeriske March 29, 2016, 11:01:57 AM
Yeah but php is fun to code with
u/Dream of Omnimaga March 29, 2016, 03:15:57 PM
I don't like it much, but it still does the job very well so I cope with it when I need to do minor changes to something. I really need to learn it thoroughly at some point, though, so I can do more theme editing or even custom pages.
u/Jokeriske March 29, 2016, 06:58:38 PM
Quote from: DJ Omnimaga on March 29, 2016, 03:15:57 PM
I don't like it much, but it still does the job very well so I cope with it when I need to do minor changes to something. I really need to learn it thoroughly at some point, though, so I can do more theme editing or even custom pages.


are you going to change the theme? the way it is now is awesome
u/Dream of Omnimaga March 29, 2016, 07:01:48 PM
Nah, I don't want to change it now, especially considering when we upgrade to SMF 2.1 (when it comes out, that is) we will have to redo the entire theme from scratch and lose every feature provided by SMF plugins that only runs on SMF 1.1 and 2.0. The potential loss of features could be another reason for learning PHP, by the way. :P
u/Jokeriske March 30, 2016, 07:13:02 PM
Quote from: DJ Omnimaga on March 29, 2016, 07:01:48 PM
Nah, I don't want to change it now, especially considering when we upgrade to SMF 2.1 (when it comes out, that is) we will have to redo the entire theme from scratch and lose every feature provided by SMF plugins that only runs on SMF 1.1 and 2.0. The potential loss of features could be another reason for learning PHP, by the way. :P

yeah :P , are there alot of new features?
u/Dream of Omnimaga March 30, 2016, 07:24:35 PM
I don't remember the highlights. The main change is that the theme is purposely made to be mobile-friendly and I often heard that the code is optimized much better. It's also open-source and on Github now, unlike previous versions of SMF which were coded by a specific team. But I hope that's not all there is in SMF 2.1 (although it would definitively make porting mods much easier).
Start a Discussion

b/Web

Website developement and scripting

68
Topics
Explore Board
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal