error message of php scripts

images php coding issues or problems here.

Moderators: macek, egami, gesf

begeiste
New php-forum User
New php-forum User
Posts: 83
Joined: Thu Jun 03, 2004 11:27 am

error message of php scripts

Postby begeiste » Fri May 27, 2005 10:09 am

Can anyone help me to figure out what is the problem of this php codes, I have followed exactly the tutorial said by this url:http://www.sitepoint.com/article/php-gallery-system-minutes/2
Thanks alot.
Here are codes:

Code: Select all

<?php include '../Connections/linker.php';
 // initialization
 $photo_upload_fields = '';
 $counter = 1;
// If we want more fields, then use, preupload.php?number_of_fields=20
 $number_of_fields = (isset($_GET['number_of_fields'])) ?
   (int)($_GET['number_of_fields']) : 5;
// Firstly Lets build the Category List
 $result = mysql_query('SELECT category_id,category_name FROM gallery_category');
 while($row = mysql_fetch_array($result)) {
   $photo_category_list .= <<<__HTML_END
<option value="$row[0]">$row[1]</option>\n
__HTML_END;
 }
 mysql_free_result( $result );   

 // Lets build the Image Uploading fields
 while($counter <= $number_of_fields) {
   $photo_upload_fields .= <<<__HTML_END
<tr><td>
 Photo {$counter}:
 <input name="photo_filename[]"
type="file" />
</td></tr>
<tr><td>
 Caption:
 <textarea name="photo_caption[]" cols="30"
   rows="1"></textarea>
</td></tr>
__HTML_END;
   $counter++;
 }

 // Final Output
 echo <<<__HTML_END
<html>
<head>
<title>Lets upload Photos</title>
</head>
<body>
<form enctype="multipart/form-data"
 action="upload.php" method="post"
 name="upload_form">
 <table width="90%" border="0"
   align="center" style="width: 90%;">
   <tr><td>
     Select Category
     <select name="category">
     $photo_category_list
     </select>
   </td></tr>
   <!—Insert the image fields here -->
   $photo_upload_fields
   <tr><td>
     <input type="submit" name="submit"
       value="Add Photos" />
   </td></tr>
 </table>
</form>
</body>
</html>
__HTML_END;
?>


Edit by Alexei Kubarev (inserted code tags)

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Postby ruturajv » Sun May 29, 2005 7:24 pm

please also let us know the problem with your script...
and use the [ CODE ] tags to show your code

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Mon May 30, 2005 12:44 am

I had to edit the post.. sorry :)


Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 1 guest

cron