Jump to content

QuickOldCar

Staff Alumni
  • Posts

    2,972
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by QuickOldCar

  1. All the GD function names and description what they do are here. http://www.php.net/manual/en/ref.image.php
  2. Just like the other guys..I personally just use notepad++ myself. But this is a good free ide editor for you. http://netbeans.org/
  3. Can try MATCH ..AGAINST or set up searches in boolean mode for exact phrases. You will need to make fulltext indexes on every field are looking in. http://dev.mysql.com/doc/refman/5.5/en/fulltext-search.html quotes usually are escaped so would have to make exceptions for those, but really those examples you have there are entirely different words as far as a computer see's them. I feel would have to make association lists to accomplish anything other than what I just showed.
  4. You would need to have massive lists and word associations for every word that could possibly be typed. Or some type of type associations you feel they may type. Maybe can link to some thesaurus somewhere, I'm not sure. To me it seems like be too much usage and mess the phrases up entirely. Now if just wanted to do something as suggestions......you would be able to insert the values such as you stated above and let them click which they prefer. http://www.w3schools.com/php/php_ajax_php.asp
  5. I'm sure that can't be all the code. If using gd are supposed to send out the header of the image type, is why are seeing the garble, plus the img as basename, pretty much the code that makes the image. Try reading some gd tutorials to do what you need, or find one already made, is plenty out there very similar to what you want to accomplish. http://www.php.net/manual/en/function.imagecopyresized.php Or this script may do everything you need already http://phpthumb.sourceforge.net/
  6. I may be able to help. What I do is a multi select for mysql depending on what is selected will bring the different results. These will not be your values, you can modify this to your own needs, but should give you the idea of how can go about it. <?php $display = mysql_real_escape_string($_GET['display']); $order = mysql_real_escape_string($_GET['order']); $search_name = mysql_real_escape_string($_GET['search_name']); $search_words = mysql_real_escape_string($_GET['search_words']); //search get variables from search form if ($search_name == "first_begins_characters") { $result = mysql_query("SELECT * FROM users WHERE firstname LIKE '".$search_words."%' ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users WHERE firstname LIKE '".$search_words."%'"); } elseif ($search_name == "first_contains_characters") { $result = mysql_query("SELECT * FROM users WHERE firstname LIKE '%"."$search_words"."%' ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users WHERE firstname LIKE '%"."$search_words"."%'"); } elseif ($search_name == "last_begins_characters") { $result = mysql_query("SELECT * FROM users WHERE lastname LIKE '".$search_words."%' ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users WHERE lastname LIKE '".$search_words."%'"); } elseif ($search_name == "last_contains_characters") { $result = mysql_query("SELECT * FROM users WHERE lastname LIKE '%"."$search_words"."%' ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users WHERE lastname LIKE '%"."$search_words"."%'"); } elseif ($search_name == "all") { $result = mysql_query("SELECT * FROM users ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users"); } else { //if anything goes wrong above or nothing selected, this will be used as the default query instead $result = mysql_query("SELECT * FROM users ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users"); } ?> <form name="input" action="" method="get"> <?php if (!$_GET['display']) { $display = "firstname"; } ?> Display:<Select style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" name="display"> <option "Input" style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="<?php echo $display; ?>"><?php echo $display; ?></option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="firstname">firstname</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="lastname">lastname</option> </select> <?php if (!$_GET['order']) { $order = "ASC"; } ?> Order:<Select style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" name="order"> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="<?php echo $order; ?>"><?php echo $order; ?></option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="ASC">Ascending</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="DESC">Descending</option> </select> <?php if (!$_GET['search_name']) { $search = "all"; } ?> Search Type:<Select style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" name="search"> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="<?php echo $search; ?>"><?php echo $search; ?></option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="all">all</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="first_begins_characters">User Begins Character(s)</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="first_contains_characters">User Contains Character(s)</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="last_begins_characters">Last Begins Character(s)</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="last_contains_characters">Last Contains Character(s)</option> </select> <br /> Search Word(s) or Char(s):<input size="40"type="text" name="search_words" style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="<?php echo $_GET['search_words']; ?>"><?php echo $_GET['search_words']; ?> <input type="submit" style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="Search Name" /> </form>
  7. I'm now wondering why I "could" do it escaped or not, lol. Maybe has to do with w/e versions using, permissions or xampp. It's cool you got it going.
  8. I can open a directory same as what daxguy has written in the code, I think it may be something else like permissions or something.
  9. I just posted some info you can use in the forum. http://www.phpfreaks.com/forums/php-coding-help/upload-script-318700/
  10. The echo shit is killing you huh? see your multi upload... <form action="" method="post" enctype="multipart/form-data"> <input type="file" name="Image1"><br> <input type="file" name="Image2"><br> <input type="file" name="Image3"><br> <input type="file" name="Image4"><br> <input type="file" name="Image5"><br><br> <input type="submit" value="GOOOOOOOO!!!!" name="submit_bilde"> </form> make it to something like this <form action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size ?>"> <input type="file" name="file[]"><br /> <input type="file" name="file[]"><br /> <input type="file" name="file[]"><br /> <input type="file" name="file[]"><br /> <input type="file" name="file[]"><br /> <input type="submit" value="GOOOOOOOO!!!!" name="submit_bilde"> </form> Then you need a loop //max fle size value $max_file_size = 50000000; //timestamp to make files unique names $timestamp = time(); //added a date for insertion to db date_default_timezone_set('America/New_York'); $my_date = date('Y-m-d H:i:s'); //destination folder path $destpath = "storage/"; //looping each file or image from the form while(list($key,$value) = @each($_FILES["file"]["name"])) { //check if any empty or errors if(!empty($value)){ if ($_FILES["file"]["error"][$key] > 0) { echo "Error: " . $_FILES["file"]["error"][$key] . "<br/>" ; } else { //add the timestamp to filename $file_name = $timestamp.$_FILES['file']['name']; //temp name from upload form, key of each is set $source = $_FILES["file"]["tmp_name"][$key] ; //getting the file type $file_type = $_FILES["file"]["type"][$key]; //getting the file size $file_size = $_FILES["file"]["size"][$key]; //placing each file name into a variable $filename1 = $_FILES["file"]["name"][$key]; //lowering the file names $filename = strtolower($filename1); //adding timestamp to front of file name $filename = "$timestamp$filename"; //moving the file to be saved from the temp location to the destination path move_uploaded_file($source, $destpath . $filename); //the actual final location with timestamped name $final_file_location = "$destpath$filename"; echo $final_file_location."<br />"; } You can also add to the form titles and description <form action="upload.php" method="post" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size ?>"> File: <input type="file" name="file[]"/> Title:<input size="40"type="text" name="title[]" style="color: lightblue; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #0000FF;" size="15" value=""> Description:<input size="40"type="text" name="description[]" style="color: lightblue; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #0000FF;" size="15" value=""><br/> File: <input type="file" name="file[]"/> Title:<input size="40"type="text" name="title[]" style="color: lightblue; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #0000FF;" size="15" value=""> Description:<input size="40"type="text" name="description[]" style="color: lightblue; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #0000FF;" size="15" value=""><br/> File: <input type="file" name="file[]"/> Title:<input size="40"type="text" name="title[]" style="color: lightblue; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #0000FF;" size="15" value=""> Description:<input size="40"type="text" name="description[]" style="color: lightblue; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #0000FF;" size="15" value=""><br/> File: <input type="file" name="file[]"/> Title:<input size="40"type="text" name="title[]" style="color: lightblue; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #0000FF;" size="15" value=""> Description:<input size="40"type="text" name="description[]" style="color: lightblue; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #0000FF;" size="15" value=""><br/> File: <input type="file" name="file[]"/> Title:<input size="40"type="text" name="title[]" style="color: lightblue; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #0000FF;" size="15" value=""> Description:<input size="40"type="text" name="description[]" style="color: lightblue; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #0000FF;" size="15" value=""><br/> <input type="submit"value="GOOOO!!!!" name="submit_bilde"> </form> In the loop add the values for title or description as each key like so $final_file_location = "$destpath$filename"; if (file_exists($final_file_location)) { ?> The file has been uploaded. <a href="<?php echo $final_file_location; ?>" target="_blank"><?php echo $filename; ?></a><br /> <?php $title = mysql_real_escape_string(trim($_POST["title"][$key])); if ($title == ''){ $title = mysql_real_escape_string(trim($filename1)); } $escaped_title = htmlentities($title, ENT_QUOTES); $description = mysql_real_escape_string(trim($_POST["description"][$key])); $escaped_description = htmlentities($description, ENT_NOQUOTES); $display_title = stripslashes($escaped_title); $display_description = stripslashes($escaped_description); echo stripslashes($display_title)."<br />"; echo "Type: $file_type<br />"; echo "Size: $file_size<br />"; echo stripslashes($display_description)."<br />"; For checking for file type if ($file_type != "image/jpeg" || $file_type != "image/gif" || $file_type != "image/jpg" || $file_type != "image/bmp" || $file_type != "image/png") { die(" <div align='center' ><h2>You inserted a file type not accepted.</h2><br /> <a href=\"javascript: history.go(-1)\">Click here to try again</a> </div>"); } Naturally the above I did are not your values and would take some modification of yours. I been slowly working on a complete upload script with a website and database included. There are plenty of tutorials on the net for whatever else need to do.
  11. You don't really need to learn flash, can download animation shop bundled with paintshop pro, should be trial version and do what you need to. Load the gif into animation shop and replace the last image in the frames with a good one, resave the file as gif and all set. http://dw.com.com/redir?edId=3&siteId=4&oId=3000-2192_4-7057820&ontId=2192_4&spi=4375e97e2d0be23c0fbd299dd20da4eb&lop=link&tag=tdw_dltext&ltype=dl_dlnow&pid=11207244&mfgId=50098&merId=50098&pguid=WMrIjQoOYJMAACuNxSIAAABH&destUrl=http%3A%2F%2Fdownload.cnet.com%2F3001-2192_4-10001995.html%3Fspi%3D4375e97e2d0be23c0fbd299dd20da4eb
  12. I made a somewhat starter site for file uploads. You are welcome to download it, modify it and use any way you see fit. It can do multiple uploads, unique file naming, add a description, if need alternate stuff can also add title or w/e in the form and make a new variable similar to way description is set up. I even made a basic website layout to see the uploaded files and included some pagination. You can download it here. http://dynainternet.com/download/videos.rar You will have to add all the security, permissions, file type checking and such for public usage. This is a headstart for you.
  13. Since you have this line outside of php and just html, you must have the start and stop for php code. so this Pitanje Ankete:<input type="text" name="$question" /> to this Pitanje Ankete:<input type="text" name="<?php echo $question;?>" /> If you echoed the html code and needed the variable, no need to have the start and stops, but do need to have them wrapped in the correct quotes at times.
  14. Was no semicolon after links array <?php // example of how to use basic selector to retrieve HTML contents include('simple_html_dom.php'); $links=array("http://www.example.com/page1.htm"," http://www.example.com/page2.htm"); foreach($links as $page) { $phtml = file_get_html($page); // find all td tags with attribite align=center foreach($phtml->find('span[id=name]') as $name){ echo $name->plaintext.'<br><br>'; } }?>
  15. I second the pagination. Can get out of hand and be like a blogspot site.
  16. do you mean something like this? $result = mysql_query("SELECT * FROM table WHERE value='value'"); if (!$result) { die('Could not connect: ' . mysql_error()); } turn on error reporting in php.ini or do you mean stuff like SHOW, DESCRIBE, EXPLAIN in the query itself
  17. I'm wondering why the int value was placed there to begin with, I'm guessing the mysql table can allow letters and not just set as int, because you are trying to use a member id that also contains a letter. Well the int value was meant to be there as some sort of security measure that was just a number and not anything else in the get value, so instead try using this. $memberid = mysql_real_escape_string($_GET['memberid']);
  18. int in that case is made to convert it to just a number, so I guess if need to have a variable with also letters, must remove the int. $memberid = $_GET['memberid'];
  19. An iframe is just a window to view whatever is in the iframe, so in reality it's still in the other location.
  20. I spent a little time and made a simple upload script and also a way to view the uploaded files in a website environment with pagination. There is the install instructions in a text file. I included a mysql file for the database. For public use there should be file checking for types, permissions or w/e else you would like to have, I hope this helps people at least. I made it available to download. http://dynainternet.com/download/videos.rar
  21. You upload a file and saves to a folder. During the upload process the files name is used as a value. That value is then inserted into mysql so can be fetched to know where the video file is located. If really needed a sample database and a script to do multiple uploads ask and I'll make it up.
  22. You pretty much answered your own question. Looking in the common places for the main page is what want to do. .htaccess for any rewrite rules index.php,index.html,index.asp and any other language is usually called index.something if no special rewrite rules are in .htaccess, you can usually just visit the website and see what the name is. Such as http://mysite.com/Home/home.html So naturally this would then be located in a folder labeled Home and within the folder the file is named home.html Many times files are included such as themes, templates, view, display folders or whatever they could be named, so see whats included and follow all those. Really is no magic way to find these, sometimes it takes having to look for it.
  23. I also like it better like this. I seem to be able to find the end brackets better all being on the one line. if ($condition) { $do_something } else { $do_something_else }
  24. If don't want any same named files being overwritten, can rename them and place a timestamp at the beginning of the filename. You can integrate the idea as you see fit to your code $timestamp = time(); $file_name = $timestamp.$_FILES['file']['name']; $source = $_FILES["file"]["tmp_name"][$key] ; $filename1 = $_FILES["file"]["name"][$key]; $filename = strtolower($filename1); $filename = "$timestamp$filename";
  25. the corrected of my mistake above, can also do stuff like adding $checked=0; for each Then at the end do a if ($checked == 0){ echo ("<br /><br /><div align='center' class='errorbox'>You didn't properly fill out the form!</div>"); echo "<meta http-equiv='refresh' content='5;url=http://somesite.com/somepage.php"; } <?php $username = $_POST['username']; $password = $_POST['password']; if ($username == 'User Name' || $username == ''){ echo ("<br /><br /><div align='center' class='errorbox'>Please enter a valid username!</div>"); echo "<meta http-equiv='refresh' content='5;url=http://somesite.com/somepage.php"; } if ($password == 'Password' || $password == ''){ echo ("<br /><br /><div align='center' class='errorbox'>Please enter a valid password!</div>"); echo "<meta http-equiv='refresh' content='5;url=http://somesite.com/somepage.php"; } ?>
×
×
  • 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.