Jump to content

tracy

Members
  • Posts

    177
  • Joined

  • Last visited

    Never

Everything posted by tracy

  1. i would like to create a one-page form using html and php/mysql including: (all on one page, one submit button) dropdown menu A with item 1 through item 20, labeled as item1, item2, etc. dropdown menu B with subitem 1 through subitem 30, labeled as subitem1, subitem2, etc. dropdown menu C with items populated form mysql tables based on dropdown menu B. therefore, each subitem from subitem 1 through subitem 30 has its own mysql table in a subitem master database. once a subitem is selected, the contents from the corresponding table would be displayed in dropdown menu C. these tables would be called 'subitem1 table' through 'subitem30 table'. each table would contain 25 rows, labeled as table1row1, table1row2, table1row3, etc...all for table one of course. table two would contain 25 rows, labeled as table2row1, table2row2, table3row3, etc., etc. //i know how to do this text box part just not sure if it will work with all the other stuff on this page with one submit button. there are two text boxes, both limited to six digits (numbers only) the first text box is text1, the second is text2. //i know how to do this text box part, just not sure if it will work with all the other stuff on this page with one submit button. on the same page with all the above there are checkboxes that are available for selection. all, none or some may be checked. there are 20 of these choices labeled checkbox1 through checkbox19. //I know how to do this photo upload/thumbnail part, just not sure if it will work with one submit button on this same page. finally, photos are uploaded and thumbnailed on the way into the table with the actual photo not saved, only the thumbnail. the actual photo not in the table but it's name only and the thumbnails stored in a separate table or database. //I know how to do this photo upload/thumbnail part, just not sure if it will work with one submit button on this same page. at the bottom of this form page there is a submit button. once submit is clicked all above selections are sent to a table called inventory. each new inventory item or line in this table is 'created' when the submit button is clicked. there is an auto increment item number for each item created, obviously. this will be the unique_id if possible. while i have looked on the internet for tutorials i have not found one that i understand with all these on the same form. as far as the mysql inventory table goes it seems to be: inventory table: unique_id, dropdownA_selection, dropdownB_selection, dropdownC_selection, textbox1_entry, textbox2_entry, checkbox1-checkbox20_selection(s)--null is ok (this done this way just to save space and time), photo1, photo2, photo3, photo4, photo5, photo6 (all photos may be null) plus i would like a column for date of file creation, a column for date of last alteration of textbox2, and a column for file creation author which may be hard coded into mysql/phpmyadmin as it will be the same for the entire table. (all files in this table that are created using this form will be from the same 'author')...no biggie, i know how to do this i think. does anyone know of a free tutorial or willing to provide free knowlege on how to do this all with one form/one submit button? as i have looked on the net please don't refer me to a tutorial unless it does all three (dropdowns, checkboxes and text boxes inserted with one submit button) please. i have seen the tutorials on one dropdown based on another dropdown selection and on basic insertion. again, not all the other stuff was included on the same form tutorial. thanks.
  2. i would like to see a free tutorial on how to do the following. i am willing to study a tutorial that includes all the items described below with one submit button. i have not found such a tutorial yet. if anyone wants to tell me how for free that is fine also. thanks. create a one-page form using html and php/mysql including: (all on one page, one submit button) dropdown menu A with item 1 through item 20, labeled as item1, item2, etc. dropdown menu B with subitem 1 through subitem 30, labeled as subitem1, subitem2, etc. dropdown menu C with items populated form mysql tables based on dropdown menu B. therefore, each subitem from subitem 1 through subitem 30 has its own mysql table in a subitem master database. once a subitem is selected, the contents from the corresponding table would be displayed in dropdown menu C. these tables would be called 'subitem1 table' through 'subitem30 table'. each table would contain 25 rows, labeled as table1row1, table1row2, table1row3, etc...all for table one of course. table two would contain 25 rows, labeled as table2row1, table2row2, table3row3, etc., etc. //i know how to do this text box part just not sure if it will work with all the other stuff on this page with one submit button. there are two text boxes, both limited to six digits (numbers only) the first text box is text1, the second is text2. //i know how to do this text box part, just not sure if it will work with all the other stuff on this page with one submit button. on the same page with all the above there are checkboxes that are available for selection. all, none or some may be checked. there are 20 of these choices labeled checkbox1 through checkbox19. //I know how to do this photo upload/thumbnail part, just not sure if it will work with one submit button on this same page. finally, photos are uploaded and thumbnailed on the way into the table with the actual photo not saved, only the thumbnail. the actual photo not in the table but it's name only and the thumbnails stored in a separate table or database. //I know how to do this photo upload/thumbnail part, just not sure if it will work with one submit button on this same page. at the bottom of this form page there is a submit button. once submit is clicked all above selections are sent to a table called inventory. each new inventory item or line in this table is 'created' when the submit button is clicked. there is an auto increment item number for each item created, obviously. this will be the unique_id if possible. while i have looked on the internet for tutorials i have not found one that i understand with all these on the same form. as far as the mysql inventory table goes it seems to be: inventory table: unique_id, dropdownA_selection, dropdownB_selection, dropdownC_selection, textbox1_entry, textbox2_entry, checkbox1-checkbox20_selection(s)--null is ok (this done this way just to save space and time), photo1, photo2, photo3, photo4, photo5, photo6 (all photos may be null) plus i would like a column for date of file creation, a column for date of last alteration of textbox2, and a column for file creation author which may be hard coded into mysql/phpmyadmin as it will be the same for the entire table. (all files in this table that are created using this form will be from the same 'author')...no biggie, i know how to do this i think. does anyone know of a free tutorial on how to do this all with one form/one submit button? as i have looked on the net please don't refer me to a tutorial unless it does all three (dropdowns, checkboxes and text boxes inserted with one submit button) please. i have seen the tutorials on one dropdown based on another dropdown selection and on basic insertion. again, not all the other stuff was included on the same form tutorial. thanks.
  3. What is the code that generates this error?
  4. I have tried to change some php code and it won't quite work.  I don't know if I'm on the right path here. I had a form that used php to update/delete the database (mysql)...it displayed the contents of the table and allowed a checkbox for selection of the file for edit or delete.  Then, it used an update to actually perform the changes...this was called update.php. I also have a form that now sends the picture file into a file folder on the server and the NAME of the same picture file into the database table...I'm trying to incorporate the two together so that the old update, which sent the actual picture file into the database will send the picture file NAME only into the database and send the picture file to a file folder. Here is what I have so far.  Obviously, the delete portion works.  The update part on the TRIALinsert.php does nothing to the table...any thoughts are appreciated. [code] [color=red]//here is the update file...named TRIALupdate.php[/color] <?php echo "<p align=center>"; // Connect to mysql include "link.php"; $absolute_path = "/home/working/public_html/misc"; $thumb_path = "/home/working/public_html/misc/thumbs";   $size_limit = "yes"; $limit_size = "600000"; $limit_ext = "yes"; $ext_count = "1"; $extensions = array(".jpg"); function resampimagejpg($forcedwidth, $forcedheight, $sourcefile, $destfile, $imgcomp)   {   $g_imgcomp=100-$imgcomp;   $g_srcfile=$sourcefile;   $g_dstfile=$destfile;   $g_fw=$forcedwidth;   $g_fh=$forcedheight;   if(file_exists($g_srcfile))       {       $g_is=getimagesize($g_srcfile);       if(($g_is[0]-$g_fw)>=($g_is[1]-$g_fh))           {           $g_iw=$g_fw;           $g_ih=($g_fw/$g_is[0])*$g_is[1];           }           else           {           $g_ih=$g_fh;           $g_iw=($g_ih/$g_is[1])*$g_is[0];           }       $img_src=imagecreatefromjpeg($g_srcfile);       $img_dst=imagecreatetruecolor($g_iw,$g_ih);       imagecopyresampled($img_dst, $img_src, 0, 0, 0, 0, $g_iw, $g_ih, $g_is[0], $g_is[1]);       imagejpeg($img_dst, $g_dstfile, $g_imgcomp);       imagedestroy($img_dst);       return true;       }       else       return false;   } if(!isset($_POST['submit'])){        if (($extensions == "") or ($extensions == " ") or ($ext_count == "0") or ($ext_count == "") or ($limit_ext != "yes") or ($limit_ext == "")) {           $extens = "any extension";        } else {        $ext_count2 = $ext_count+1;        for($counter=0; $counter<$ext_count; $counter++) {            $extens = "&nbsp; $extensions[$counter]";        }        }        if (($limit_size == "") or ($size_limit != "yes")) {            $limit_size = "any size";        } else {            $limit_size .= " bytes";            $mb_size = ($limit_size/1000000);        }        $pichead = "<li><font size=\"2\" color=660000>File extension must be $extens<b>";        $pichead .="</b></font>        <li><font size=\"2\" color=660000>Maximum file size is $limit_size ($mb_size MB)</font></li>        <li><font size=\"2\" color=660000>No spaces in the filename</font></li>"; ?> <?php } else { $i=0; $photoarray = array();  foreach ($_FILES["pictures"]["error"] as $key => $error) {  $file_name =  $_FILES["pictures"]['name'][$i]; // can call this anything you like this will take the original name  $file =  $_FILES["pictures"]['tmp_name'][$i];  $photoarray[$i+1]= $file_name;  $endresult = "<font size=\"4\" color=990000>$file_name uploaded successfully</font>";    if ($file_name == "") {    $pic = $i+1;    $endresult = "<font size=\"4\" color=990000>Pic#$pic Not selected</font>";    }else{      if(file_exists("$absolute_path/$file_name")) {      $endresult = "<font size=\"4\" color=990000>File Already Existed</font>";      } else {        if (($size_limit == "yes") && ($limit_size < $file_size)) {        $endresult = "<font size=\"4\" color=990000>File was to big</font>";        } else {        $ext = strrchr($file_name,'.');          if (($limit_ext == "yes") && (!in_array($ext,$extensions))) {          $endresult = "<font size=\"4\" color=990000>File is wrong type</font>";          }else{          // Save full size image with max width/height          resampimagejpg(1000,1000,$file,"$absolute_path/$file_name",0);          // Save thumb image with max width/height of 200          resampimagejpg(200,200,$file,"$thumb_path/$file_name",0);          //copy($file, "$absolute_path/$file_name") or $endresult = "<font size=\"4\" color=990000>Couldn't Copy File To Server</font>";          }        }      }    }  $i++;  echo $endresult."<br>";  } /********* Connection to mysql below  **********/ include "link.php"; /*********** End connection string ************/ $sql = "INSERT INTO inventory SET        stock = '".$_POST['stock']."',        year = '".$_POST['year']."',        make = '".$_POST['make']."',        model = '".$_POST['model']."',        miles = '".$_POST['miles']."',        price = '".$_POST['price']."',        photo1 = '".$photoarray[1]."',        photo2 = '".$photoarray[2]."',        photo3 = '".$photoarray[3]."',        photo4 = '".$photoarray[4]."',        photo5 = '".$photoarray[5]."',        photo6 = '".$photoarray[6]."'"; $res = mysql_query($sql); if(!$res){ echo "Could not insert Row<br>Error: ".mysql_error()."<br>SQL: ".$sql; } else { echo "Row inserted"; } } ?> </body> </html> [color=red]//here is the actual TRIALeditDELETE.php file...[/color] //used to display the contents of database table and selection for edit and deletion <?php include ("link.php"); // Check to see if the edit button was pressed if(isset($_POST['edit'])){ // start your array of id's $ids = array(); // fill your array with the id's selected    foreach($_POST['stockid'] as $id){    $ids[] = $id;    } // start your form echo "<form name=edit action=\"update.php\" method=POST>"; // Loop through the id's. query database to get infor for each id  foreach($ids as $stockid){  $sql = "SELECT * FROM inventory WHERE id = $stockid";  $res = mysql_query($sql) or die (mysql_error());  $i=0;  $r = mysql_fetch_array($res); // print the form for each id  echo "<table width=500 align=center>";  echo "<tr><td colspan=2 align=center><font color=red size=4><b>Now editing Stock# ".$r['stock']."</b></font></td></tr>";    while($i < mysql_num_fields($res)){    $meta = mysql_fetch_field($res, $i);      /*****************      If you would like to modify the stock number, remove **** && $meta->name <> "stock"  **** below      ******************/      if($meta->name <> "id" && $meta->name <> "stock"){      echo "<input type=hidden name=stockid[".$r['id']."] value=\"".$r['id']."\">";      print '<tr>             <td width=150>'.$meta->name.'</td>             <td width=350><input type=text size=50 name="'.$meta->name.'['.$r['id'].']" value="'.$r[$i].'"></td>             </tr>';      }    $i++;    }  echo "<hr>";  }  print '<tr>         <td colspan=2 align=center><input type=submit value=Change></td>         </tr>         </table>         </form>'; } else { // check to see if the delete button has been pressed  if(isset($_POST['del'])){  // Start array of id's  $ids = array();  // Fill array with values  foreach($_POST['stockid'] as $id){  $ids[] = $id;  }  // Loop through array and delete each id  foreach($ids as $stockid){  $sql = "DELETE FROM inventory WHERE id = $stockid";  $res = mysql_query($sql) or die (mysql_error());    if(!$res){    echo "Could not DELETE stock# $stockid<br>SQL: $sql<br> Error: ".mysql_error();    } else {    echo "Stock# $stockid Sucessfully deleted<br>";    }  }  echo "Click <a href=\"stockmanage.php\">HERE</a> To return to stock list</p>"; } else { // If nothing has been pressed show list of stock items  if($query= mysql_query("SELECT * FROM inventory")){  $num = mysql_num_rows($query);  } else {  die('There was an error with the query:'.mysql_error());  }  if ($num == '0') {  echo "Nothing Exist.";  die(); } else { ?> <form action="" method=POST> <table border="0" cellspacing="2" cellpadding="2"> <tr> <td><font face=Arial>Stock#</font> </td> <td><font face=Arial>Year</font> </td> <td><font face=Arial>Make</font> </td> <td><font face=Arial>Model</font> </td> <td><font face=Arial>Price</font> </td> <td><font face=Arial>Miles</font> </td> <td><font face=Arial>Photo</font> </td> <td><font face=Arial>Select</font> </td> </tr> <? $bgcolor = "FFFFFF"; while ($info = mysql_fetch_array($query)) { $id = $info['id']; // Put your id field here!!! $stock = $info['stock']; $year = $info['year']; $make = $info['make']; $model = $info['model']; $price = $info['price']; $miles = $info['miles']; $photo1 = $info['photo1']; // Alternate row color if ($bgcolor == "#E0E0E0"){  $bgcolor = "#FFFFFF"; } else {  $bgcolor = "#E0E0E0"; } echo (" <tr bgcolor=$bgcolor> <td> <font face=Arial>$stock</font> </td> <td> <font face=Arial>$year</font> </td> <td> <font face=Arial>$make</font> </td> <td> <font face=Arial>$model</font> </td> <td> <font face=Arial>$price</font> </td> <td> <font face=Arial>$miles</font> </td> <td> <font face=Arial>$photo1</font> </td> <td colspan=2 align=center><input type=checkbox name=stockid[] value=$id> </td> </tr> "); } echo "<tr> <td align=center colspan=8><input type=Submit name=edit value=Edit>&nbsp;&nbsp;&nbsp;<input type=Submit name=del onclick=\"return confirm('Are you sure you wish to delete the selected item(s)?');\" value=Delete> </td> <tr> </table> </form>"; } } } ?> [/code]
  5. Thanks for the kind info... I cut and paste the table I want into the php code table near the bottom of the php code after echo "... I get errors like unexpected / or that it actually expected a "," or ";" Then I take out that line, and the next until I get the error gone... Then, obviously the table doesn't echo correctly... I think I'm going to have to put the individual php commands in the cells for each time I want to call info into that cell, but in a complicated php code like this I don't know if that would even work, let alone how to start... The php basically prints each line in the database on a line of its own now...fine. I want the info printed in a way that sort of pieces it together in a table within a table...as the table in the first of the post. Any info is appreciated. [quote author=jcbarr link=topic=119588.msg489956#msg489956 date=1166754262] When you are posting snippets of your code enclose it in the code tags, if you look at the buttons when you are posting you should be able to find it. Also, what is it that you want to change with this table? Is it not echoing correctly? Are the variables not being printed? [/quote]
  6. Thanks for the attitude...NOT!  I don't know anything about tags...I'm learning!!!  [quote author=Crayon Violent link=topic=119588.msg489951#msg489951 date=1166753007] care to explain what kind of errors you are getting? or what you mean by "I want to 'change the format' of the table?" Change it to what? And also can you please show at least a small amount of respect by using code tags. [/quote]
  7. I have a display page that echoes a table.  I'd like to change the format of the table.  This is the table I'd like to have it display, with the appropriate "$whatever" in each cell... <div align="center">   <center>   <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="600">     <tr>       <td>       <div align="center">         <center>         <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">           <tr>             <td width="100%">             <div align="center">               <center>               <table border="0" cellpadding="3" cellspacing="3" style="border-collapse: collapse" bordercolor="#111111" width="100%">                 <tr>                   <td width="16%" align="center">".$photo1."</td>                   <td width="16%" align="center">".$photo2."</td>                   <td width="17%" align="center">".$photo3."</td>                   <td width="17%" align="center">".$photo4."</td>                   <td width="17%" align="center">".$photo5."</td>                   <td width="17%" align="center">".$photo6."</td>                 </tr>               </table>               </center>             </div>             </td>           </tr>           <tr>             <td width="100%">             <div align="center">               <center>               <table border="0" cellpadding="3" cellspacing="3" style="border-collapse: collapse" bordercolor="#111111" width="100%">                 <tr>                   <td width="33%" align="center">".$stock."</td>                   <td width="33%" align="center">".$year."</td>                   <td width="34%" align="center">".$make."</td>                 </tr>                 <tr>                   <td width="33%" align="center">".$model."</td>                   <td width="33%" align="center">".$price."</td>                   <td width="34%" align="center">".$miles."</td>                 </tr>               </table>               </center>             </div>             </td>           </tr>         </table>         </center>       </div>       </td>     </tr>   </table>   </center> </div> Here is the current php code... <?php include('link.php'); // Link to thumbnail images in reference to where this page is $thumb_path = "thumbs"; // this will be in a thumbs folder in the same directory as this file // Link to full size images in reference to where this page is $full_path =  "."; // this would mean the full size images are in this same folder $query= mysql_query("SELECT * FROM inventory") or die("ERROR:" . mysql_error()); $num = mysql_num_rows($query); if ($num == '0') { echo "No Data To Display In This Database."; die(); } else { ?> <table border="0" cellspacing="2" cellpadding="2"> <tr> <td><font face=Arial></font> </td> <td><font face=Arial></font> </td> <td><font face=Arial></font> </td> <td><font face=Arial></font> </td> <td><font face=Arial></font> </td> <td><font face=Arial></font> </td> <td><font face=Arial></font> </td> <td><font face=Arial></font> </td> </tr> <?php while ($info = mysql_fetch_array($query)) { $stock = $info['stock']; $year = $info['year']; $make = $info['make']; $model = $info['model']; $price = $info['price']; $miles = $info['miles']; if($info['photo1'] == NULL){ $photo1 = "[No image]"; } else { $photo1 = "<a href=\"".$full_path."/".$info['photo1']."\"><img src=\"".$thumb_path."/".$info['photo1']."\"></a>"; } if($info['photo2'] == NULL){ $photo2 = "[No image]"; } else { $photo2 = "<a href=\"".$full_path."/".$info['photo2']."\"><img src=\"".$thumb_path."/".$info['photo2']."\"></a>"; } echo " <tr> <td> <font face=Arial>".$stock."</font> </td> <td> <font face=Arial>".$year."</font> </td> <td> <font face=Arial>".$make."</font> </td> <td> <font face=Arial>".$model."</font> </td> <td> <font face=Arial>".$price."</font> </td> <td> <font face=Arial>".$miles."</font> </td> <td> <font face=Arial>".$photo1."</font> </td> <td> <font face=Arial>".$photo2."</font> </td> <td> <font face=Arial>".$photo3."</font> </td> <td> <font face=Arial>".$photo4."</font> </td> <td> <font face=Arial>".$photo5."</font> </td> <td> <font face=Arial>".$photo6."</font> </td> </tr> "; } ?> </table> <?php } ?> Any advice is appreciated.  I tried to change the table but it keeps getting errors.  I think I might have to put each php command in each cell, but don't know how.  Thanks.
  8. What I'm saying is this...if you send that much data to the browser, it seems to me that it must go on at least two lines because all of it won't print on one...or am I misunderstanding the issue? [quote author=franknu link=topic=119284.msg489638#msg489638 date=1166714552] ok i have a form where all the data is being submitted from all the text goes to one row but the file is going to  the next row, i think that my problem is on the insert code [/quote]
  9. if you choose say five columns to display on your php page, how does that look? [quote author=franknu link=topic=119284.msg489634#msg489634 date=1166714255] i made my database 22 colums and still the file is uploaded file is going to a diffrent row please help [/quote]
  10. I don't guess you HAVE to, but if all those columns won't display across one screen, then that is likely your problem...and in my opinion deleting some columns from this display php code could solve it.  I don't think you should necessarily delete them from the database, perhaps just the table being displayed on the php page in question. [quote author=franknu link=topic=119284.msg489609#msg489609 date=1166712271] yes i have 24 colums? so do i have to delete some colums [/quote]
  11. tracy

    Install on PC

    I installed Apache and PHP on my laptop.  The installs went fine.  I then installed MYSQL and tried to follow the instructions to 'link Apache and MYSQL' so they can communicate.  Didn't work. Is there an easy remedy or install for just the mysql or should I just delete the Apache, PHP and MYSQL and start over with WAMP installer of some sort?  Thanks.
  12. It sounds like the issue is with connection, no?  Are you running this on your computer to test instead of a live server?  Unless there is db connection successful, there will be no proper code function.  I find that the connection verification right up front is my typical first issue.  Once that is overcome, the code specific functions otherwise can be addressed.  My opinion only... [quote author=wulfgar link=topic=119385.msg489546#msg489546 date=1166701868] LOL, i have no idea why it is doing this  ??? ??? Fatal error: Call to undefined function: odbc_fetch_array() in c:\apache\htdocs\db_connection.php on line 43 it just doesn't like that function within the odbc driver. soo frustrating. [/quote]
  13. Ray (and others who helped), Thanks for all your effort and patience.  It is solved.  I appreciate it.  It appears that the problem was location of my folders.  It seems I had the paths correct, but due to the structure of the files and directories, the php wouldn't work.  I changed some things around...and rewrote small parts of the code in relation to that.  Thanks again.
  14. Thank you but I don't want them in the database, just a reference to them via a thumbnail.  New user?  Welcome to phpfreaks.com... [quote author=php001 link=topic=118784.msg489062#msg489062 date=1166637038] [quote author=complex05 link=topic=118784.msg485670#msg485670 date=1166214222] If you really do what to put the images directly into the database, here is a good tutorial on how to do it. http://www.phpfreaks.com/tutorials/85/0.php Hope that helps! [/quote] Thanks. really Good tutorial . [/quote]
  15. So, based on what you are saying, what should the code be at the path section...because none I have tried shows the photos/thumbnails...only red x's... I have tried: thumbs /thumbs images/thumbs public_html/images/thumbs home/working/public_html/images/thumbs What am I missing here? I even tried to change the path in the actual mysql database to add the path directly there...no success.  Thanks.
  16. I have solved the paths issue.  I think.  Files, including photos, no longer generate errors on upload.  However, they only display red x in table when viewed via the display page in php...here is the code for that page...I am only displaying one photo for now, just to test... <?php include('link.php'); // Link to thumbnail images in reference to where this page is $thumb_path = "/home/working/public_html/images/thumbs"; // this will be in a thumbs folder in the same directory as this file // Link to full size images in reference to where this page is $full_path =  "."; // this would mean the full size images are in this same folder $query= mysql_query("SELECT * FROM inventory") or die("ERROR:" . mysql_error()); $num = mysql_num_rows($query); if ($num == '0') { echo "Nothing Exist."; die(); } else { ?> <table border="0" cellspacing="2" cellpadding="2"> <tr> <td><font face=Arial>Stock#</font> </td> <td><font face=Arial>Year</font> </td> <td><font face=Arial>Make</font> </td> <td><font face=Arial>Model</font> </td> <td><font face=Arial>Price</font> </td> <td><font face=Arial>Miles</font> </td> <td><font face=Arial>Photo1</font> </td> <td><font face=Arial>Photo2</font> </td> </tr> <?php while ($info = mysql_fetch_array($query)) { $stock = $info['stock']; $year = $info['year']; $make = $info['make']; $model = $info['model']; $price = $info['price']; $miles = $info['miles']; if($info['photo1'] == NULL){ $photo1 = "[No image]"; } else { $photo1 = "<a href=\"".$full_path."/".$info['photo1']."\"><img src=\"".$thumb_path."/".$info['photo1']."\"></a>"; } if($info['photo2'] == NULL){ $photo2 = "[No image]"; } else { $photo2 = "<a href=\"".$full_path."/".$info['photo2']."\"><img src=\"".$thumb_path."/".$info['photo2']."\"></a>"; } echo " <tr> <td> <font face=Arial>".$stock."</font> </td> <td> <font face=Arial>".$year."</font> </td> <td> <font face=Arial>".$make."</font> </td> <td> <font face=Arial>".$model."</font> </td> <td> <font face=Arial>".$price."</font> </td> <td> <font face=Arial>".$miles."</font> </td> <td> <font face=Arial>".$photo1."</font> </td> <td> <font face=Arial>".$photo2."</font> </td> </tr> "; } ?> </table> <?php } ?>
  17. why do I see home and user in your path?  Can you explain more?  Thanks. My www is the file folder that holds the php page...it is a clone of the public_html file...then inside that is the image file and inside that the thumbs file.  Thanks. [quote author=simcoweb link=topic=118784.msg488453#msg488453 date=1166559319] Create the folder like craygo pointed out: /home/user/public_html/misc/images/thumbs Your path may be different so plug in the necessary replacements. Then, set the folder permissions to 777. BUT, be SURE to put an 'index.htm' file in that folder . This prevents snoopers from simply typing in your images/thumbs url and displaying all your pics. The index.htm file will show up by default. It can be as simple as one line of text saying 'You shouldn't be here'. [/quote]
  18. Is it simply displaying two rows because there is not enough room no the screen to show all in one?  It's 23 columns right?  They might not fit into one row...is that the issue?  Might seem like a silly question but it might be the answer...
  19. Are you saying that you want to have one page with the last and first name only using php AND another page with first and last name and other info?  If so, it's simply a matter of displaying more cells in the database, right? If not, maybe I misunderstood the question.  Sorry.
  20. Would you be able to add another column with the words 'view file' and the hyperlink attached for each row? Would that work for your site?
  21. Thanks for index file info...did that... [quote author=simcoweb link=topic=118784.msg488453#msg488453 date=1166559319] Create the folder like craygo pointed out: /home/user/public_html/misc/images/thumbs Your path may be different so plug in the necessary replacements. Then, set the folder permissions to 777. BUT, be SURE to put an 'index.htm' file in that folder . This prevents snoopers from simply typing in your images/thumbs url and displaying all your pics. The index.htm file will show up by default. It can be as simple as one line of text saying 'You shouldn't be here'. [/quote]
  22. I've (yesterday) tried it with and without the slashes...here is the error when I use simply "public_html/images" and "public_html/images/thumbs"... Warning: imagejpeg() [function.imagejpeg]: Unable to open 'public_html/images/ephotos 3 002.jpg' for writing in /home/working/public_html/imageUPLOAD.php on line 34 Warning: imagejpeg() [function.imagejpeg]: Unable to open 'public_html/images/thumbs/ephotos 3 002.jpg' for writing in /home/working/public_html/imageUPLOAD.php on line 34 ephotos 3 002.jpg uploaded successfully I only tried to upload one file.  The data went into database with photo name, only this error shows and photo isn't showing in db, obviously... It says it can't open the actual image, as the image name is ephotos 3 002.jpg that I tried to send... I can't see the image loaded in the file, either, on the server so I know it didn't go... Any further advice is appreciated.  You stated that you tried it on your site and it works...can you tell me if I should substitute the word home or user or something for my domain name...even though I tried all that, I could have missed one combination that might work.  Thanks... [quote author=craygo link=topic=118784.msg488516#msg488516 date=1166568389] problem is your putting a "/" at the end of the paths. they should be [code]$absolute_path = "/public_html/images"; //Absolute path to where files are uploaded $thumb_path = "/public_html/images/thumbs";  //Absolute path to where thumbs are to be stored if you want this[code] Actually you need to put the actual path which is from the root [code]$absolute_path = "/home/username/public_html/images"; //Absolute path to where files are uploaded $thumb_path = "/home/username/public_html/images/thumbs";  //Absolute path to where thumbs are to be stored if you want this[/code] Ray [/code][/code] [/quote]
  23. I am getting errors Warning: imagejpeg() [function.imagejpeg]: Unable to open '/public_html/images//Auto Alt 6-9-06 005.jpg' for writing in /home/working/public_html/imageUPLOAD.php on line 34 Warning: imagejpeg() [function.imagejpeg]: Unable to open '/public_html/images/thumbs//Auto Alt 6-9-06 005.jpg' for writing in /home/working/public_html/imageUPLOAD.php on line 34 I changed the permissions several times to various levels, including 777...no success. It is writing to the database table, not fixing the picture problem.  Any ideas?  Thanks for all your help... [quote author=craygo link=topic=118784.msg488253#msg488253 date=1166542773] ok give me your directory structure and I will fix it example the php file location /home/mydomain/public_html thumbnails folder /home/mydomain/public_html/images/thumbs full size images /home/mydomain/public_html/images now since the php file is in the web root, in order to access the files, you would have to use this $thumbs_path = "images/thumbs"; $full_path = "images"; All file paths and links are always in reference to where the script is running from. Also yes if the images are in the same folder as the php file then you would use "." If it is a linux box make the images folder chmod 777. And you need to make it recursive in order to make sure all folders under the images folder get the permissions also. If not go to each folder seperately. Ray [/quote]
×
×
  • 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.