Jump to content

jakebur01

Members
  • Posts

    885
  • Joined

  • Last visited

Everything posted by jakebur01

  1. Hi Keith, Would you just check to see how many blank rows are needed to make 4? And then insert like 4 <td> </td>'s ?
  2. I am trying to create a "browse members" page. This page will display thumbnails in a table about 4 columns wide. I am not sure what the best way to set up the table would be. I am not sure how to count and loop through 4 <td>'s and then insert the <tr> tag. How would you do this? Like: <table width=100%> select username, nickname, image_link FROM user_table while { } </table>
  3. Ha Ha.... my head way starting to get foggy and his footer looked as though it were part of the post. Sorry.... Thank you for all your help. It is working great now.
  4. Does ini_set ("display_errors", "1"); error_reporting(E_ALL); log errors when someone is trying to inject stuff into url? How will you know when they are trying to do that? Isn't that what that is for? I read a little bit on ini_set ("display_errors", "1"); error_reporting(E_ALL); but I was having trouble understanding exactly how it works. - Jake
  5. Where would these errors be reported to? Would they go to my web host? Is there a way to have them e-mailed to me?
  6. it is all under if (isset($_SESSION['valid_user'])) { }
  7. my image names have underscores and periods in it. I read: Returns a string in which all non-alphanumeric characters except -_. I want to do this the best way. I didn't know if urlencode would be the best option.
  8. to delete an image, could i do something like this? echo"<a href=\"view_images.php?delete=urlencode($file)\">delete image</a> then if (isset($_GET['delete'])) { $delete_image=c:/images/urldecode($_GET['delete']); unlink("delete_image"); }
  9. Ha.. That got it. Thank you so much!
  10. That displayed only 3 images. It is missing 13330MarThu2009.jpg, 100_0383.JPG, 100_0388.JPG. The three it displayed were 100_0381.JPG, 100_0384.JPG, 100_0389.JPG. $file = readdir($dir_handle); $image_types = array("jpg","jpeg","gif","png"); while (false !== ($file = readdir($dir_handle))) { if(in_array(strtolower(substr($file,strpos($file,".")+1)),$image_types)){ $html .= "<tr><td><center><IMG SRC='/gallery/$_SESSION[valid_user]/uploads/{$file}' width='100' align='top' vspace='2' alt='{$file}' /></center></td><td>{$file}</td></tr>"; $file = readdir($dir_handle); } } closedir($dir_handle);
  11. I am having trouble integrating the glob() into my script. I do not know how to use it. $image_path = dirname(__FILE__) . "/gallery/$_SESSION[valid_user]/uploads"; $dir_handle = null; if (!($dir_handle = opendir($image_path))) { //trigger_error('error, path not found'); return; } $html = '<table width="500">'; $file = readdir($dir_handle); $imgs = glob('{*.jpg,*.jpeg,*.gif,*.png}', GLOB_BRACE); while (false !== ($file = readdir($dir_handle))) { if($file==$imgs){ $html .= "<tr><td><center><IMG SRC='/gallery/$_SESSION[valid_user]/uploads/{$file}' width='100' align='top' vspace='2' alt='{$file}' /></center></td><td>{$file}</td></tr>"; $file = readdir($dir_handle); } } closedir($dir_handle); // $html .= '<input type="submit" name="submit" value="Submit" />'; $html .= "</table>"; echo $html; if (!empty($file_ary))
  12. I made the changes. It is not displaying any errors. It is also not displaying any images. <?php //$file_ary = isset($_POST['rfile']) ? $_POST['rfile'] : array(); $image_path = dirname(__FILE__) . "/gallery/$_SESSION[valid_user]/uploads"; $dir_handle = null; if (!($dir_handle = opendir($image_path))) { //trigger_error('error, path not found'); return; } $html = '<table width="500">'; $file = readdir($dir_handle); $image_types = array("jpg","jpeg","gif","png"); while (false !== ($file = readdir($dir_handle))) { if(in_array(substr($text,strpos($text,".")+1),$image_types)){ $html .= "<tr><td><center><IMG SRC='/gallery/$_SESSION[valid_user]/uploads/{$file}' width='100' align='top' vspace='2' alt='{$file}' /></center></td><td>{$file}</td></tr>"; $file = readdir($dir_handle); } } closedir($dir_handle); // $html .= '<input type="submit" name="submit" value="Submit" />'; $html .= "</table>"; echo $html; if (!empty($file_ary)) { echo '<pre>'; print_r($file_ary); echo '</pre>'; } ?>
  13. I was trying to add if statements into the while loop to see if it is an image. But, I couldn't not make it work. I am only wanting to display images here. Right now it is listing all the files now. When it lists the files, it list one . and the second line is .. $image_path = dirname(__FILE__) . "/gallery/$_SESSION[valid_user]/uploads"; $dir_handle = null; if (!($dir_handle = opendir($image_path))) { //trigger_error('error, path not found'); return; } $html = ''; $file = readdir($dir_handle); while ($file) { $html .= "<IMG SRC='/gallery/$_SESSION[valid_user]/uploads/{$file}' width='100' align='top' vspace='2' alt='{$file}' />{$file}<br />\r\n"; $file = readdir($dir_handle); } closedir($dir_handle); // $html .= '<input type="submit" name="submit" value="Submit" />'; // $html .= "</form></html>"; echo $html;
  14. How can I modify this function to get only a list of image urls stored in a db rather than just getting ALL the images in a directory? Example: something like: SELECT image_file_name FROM image_table WHERE `Username` = '$_SESSION[user]'; and store this list of file names into the array in the function below rather than just getting all the files in the directory. #-############################################# # desc: gets the list of image files in the directory # param: [optional] directory to look through # returns: array with alphabetically sorted list of images function GetFileList($dirname="."){ global $config; $list = array(); if ($handle = opendir($dirname)) { while (false !== ($file = readdir($handle))) { //this matches what type of files to get. jpeg, jpg, gif, png (ignoring case) if (preg_match("/\.(jpe?g|gif|png)$/i",$file)) { $list[] = $file; } } closedir($handle); } sort($list); return $list; }#-#GetFileList()
  15. Yea, I tried that first. I couldn't get it to work. Here is the parameter it is going into. $myPic = "<IMG SRC=\"".$treatment_link."\" width=\"100\" align=\"top\" vspace=\"2\" alt=\"\"/> "; $params['nickmeta']['pic'] = $myPic;
  16. How can I make my variable work here? I cannot seem to get my quotes right. $myPic = ' <IMG SRC="$treatment_link" width="100" align="top" vspace="2" alt=""/> ';
  17. I am going to create a directory within my images directory called flags. This flags directory will contain little gif's of different countries. I am trying to figure out how I should name the images as I save them. Like I will be pulling the flag image based on the country name. But, I do not know how it will handle the spaces in the word. And how it would handle characters like this... Virgin Islands (British) ..... or commas Macedonia, Former Yugoslav Republic Of example // like sql ..... select statement while loop{ $image=$row[country]; (@file_exists('images/flags/'.($image).'.gif')) { echo '<td><img src=\'images/flags/'.$image.'.gif\' border=0 width=60 height=40> } { this is the way the countries look in the select form when they sign up.... so this is what they will look like in the db Afghanistan Åland Islands Albania Algeria American Samoa Andorra Angola Anguilla Antarctica Antigua and Barbuda Argentina Armenia Aruba Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bermuda Bhutan Bolivia Bosnia and Herzegovina Botswana Bouvet Island Brazil British Indian Ocean territory Brunei Darussalam Bulgaria Burkina Faso Burundi Cambodia Cameroon Canada Cape Verde Cayman Islands Central African Republic Chad Chile China Christmas Island Cocos (Keeling) Islands Colombia Comoros Congo Congo, Democratic Republic Cook Islands Costa Rica Côte d'Ivoire (Ivory Coast) Croatia (Hrvatska) Cuba Cyprus Czech Republic Denmark Djibouti Dominica Dominican Republic East Timor Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Ethiopia Falkland Islands Faroe Islands Fiji Finland France French Guiana French Polynesia French Southern Territories Gabon Gambia Georgia Germany Ghana Gibraltar Greece Greenland Grenada Guadeloupe Guam Guatemala Guinea Guinea-Bissau Guyana Haiti Heard and McDonald Islands Honduras Hong Kong Hungary Iceland India Indonesia Iran Iraq Ireland Israel Italy Jamaica Japan Jordan Kazakhstan Kenya Kiribati Korea (north) Korea (south) Kuwait Kyrgyzstan Lao People's Democratic Republic Latvia Lebanon Lesotho Liberia Libyan Arab Jamahiriya Liechtenstein Lithuania Luxembourg Macao Macedonia, Former Yugoslav Republic Of Madagascar Malawi Malaysia Maldives Mali Malta Marshall Islands Martinique Mauritania Mauritius Mayotte Mexico Micronesia Moldova Monaco MongoliaMontenegro Montserrat Morocco Mozambique Myanmar Namibia Nauru Nepal Netherlands Netherlands Antilles New Caledonia New Zealand Nicaragua Niger Nigeria Niue Norfolk Island Northern Mariana Islands Norway Oman Pakistan Palau Palestinian Territories Panama Papua New Guinea Paraguay Peru Philippines Pitcairn Poland Portugal Puerto Rico Qatar Réunion Romania Russian Federation Rwanda Saint Helena Saint Kitts and Nevis Saint Lucia Saint Pierre and Miquelon Saint Vincent and the Grenadines Samoa San Marino Sao Tome and Principe Saudi Arabia Senegal Serbia Seychelles Sierra Leone Singapore Slovakia Slovenia Solomon Islands Somalia South Africa South Georgia and the South Sandwich Islands Spain Sri Lanka Sudan Suriname Svalbard and Jan Mayen Islands Swaziland Sweden Switzerland Syria Taiwan Tajikistan Tanzania Thailand Togo Tokelau Tonga Trinidad and Tobago Tunisia Turkey Turkmenistan Turks and Caicos Islands Tuvalu Uganda Ukraine United Arab Emirates United Kingdom United States of America Uruguay Uzbekistan Vanuatu Vatican City Venezuela Vietnam Virgin Islands (British) Virgin Islands (US) Wallis and Futuna Islands Western Sahara Yemen Zaire Zambia Zimbabwe
  18. How can I select the unique values in a column? For instance: If I have United States on 4 rows, Peru on 3, and Argentina on 5.......... but only want to select them once and order them.... like Argentina, Peru, United States. I am trying to list users by country. Something like: select countries from db while{ echo"<h3>$row[country]</h3><br />"; select * users where $row[country] while{ echo"$row[company]<br />$row[address]<br />......... etc } {
  19. Are there any chat scripts out there that are better than phpfreechat? I have been fooling around with that one since August of 2008 and I have had a lot of problems with it.
  20. What are my other options besides the irc route? I want this embedded inside my webpage for my current user accounts.
  21. It takes a price file from a vendor, makes a few calculations, and spits out a price file that will import into an inventory program.
  22. The flat file has a different number of columns every time. So I was steering away from making a static table to upload my flat files into.
  23. So IRC runs on someone else's server? There are many people associated with IRC on google. Do you have a preference as to which on would be better? And I could integrate this into my website and my current users stored in mysql?
×
×
  • 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.