Join us on Discord!
You can help CodeWalrus stay online by donating here.

php error

Started by Jokeriske, March 27, 2016, 07:07:10 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Jokeriske

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 :/

Jokeriske

Problem solved, please lock this :)

Dream of Omnimaga

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.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Yuki

Please tell how you solved it, so others can see what was wrong.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Jokeriske

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>';

Dream of Omnimaga

I see. I noticed that PHP can be picky when I did some SMF theme editing. X.x
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Jokeriske

Yeah but php is fun to code with

Dream of Omnimaga

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.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Jokeriske

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

Dream of Omnimaga

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
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Jokeriske

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?

Dream of Omnimaga

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).
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal