Jump to content

[SOLVED] Help with a script


hillbilly928

Recommended Posts

Hello i am very new at PHP. I know very little of the language. I am very intrested in learning it though. I have been reading a lot of tutorials and gathering as much information as i can. I have now started to work on a same script to loop image output for a friends website.

 

<?php 

$thumblocal = "http://www.montagestudio.org/Site/Tutorials_files/";
$thumbfile = "Face-screen1";
$imgnumber = '5'

For ($i < $imgnumber $i = $i++)
{
echo '<a href=' . $thumblocal . '' . $thumbfile . '$i'.jpg />
<img src=' . $thumblocal . '' . $thumbfile . '$i'.jpg width ="130" height="90" /></a>
'}
next;?>

 

This is just a test and for my learning more than anything else. I keep getting an error on line 7. Could someone please help me fix this and explain what i am doing wrong with it.

Link to comment
Share on other sites

you don't have the proper syntax should be something like the following

 

 

<?php 

$thumblocal = "http://www.montagestudio.org/Site/Tutorials_files/";
$thumbfile = "Face-screen1";
$imgnumber = '5';

for ($i=1;$i <= $imgnumber;$i++)
{
echo "<a href='{$thumblocal}{$thumbfile}{$i}.jpg'><img src='{$thumblocal}{$thumbfile}{$i}.jpg' width ='130' height='90' /></a>";
}
?>

 

you will notice and see the changes made

Link to comment
Share on other sites

PHP_PhREEEk -- Thank you for the link it explained quite a bit. I must admit it was a little confusing but i think i understand it now.

 

darkfreaks -- Umm that did nothing.... but i will double check.

 

rajivgonsalves -- Thank you for the code it works great. I am now going throught it and seeing what and why mine was wrong.

 

Thank you for all your help.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.