Jump to content

squiblo

Members
  • Posts

    483
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by squiblo

  1. still only works when i click the "search" button. It does not show any results when i just press enter.
  2. <div id="searchengine" style="position:absolute;top:160px;left:312px;z-index:15"> <form action='/results.php' method='GET'> <font face='sans-serif' size='6'> <input type='text' size='15' name='search'><input type='submit' name='submit' value='Search'> </font> </form> </div>
  3. :facewall: :facewall: :facewall:
  4. if you dont understand my problem, please say and ill try to explain more
  5. I dont know the best way to describe my problem but ill give it ago, ok...i have a search engine and it works fine with all browsers apart from Interent Explorer, with IE the search only works when I click enter with my mouse but does not work when I press enter on the keyboard, this has confused me for days now, here is my search script, can anyone solve this for me please. <font face="arial"> <?php //get data $button = $_GET['submit']; $search = $_GET['search']; if (!$button) header("location:advsearch.php"); else { if (strlen($search)<3) header("location:advsearch.php"); else { echo ""; //connect to our database mysql_connect("localhost","***","***"); mysql_select_db("***"); //explode our search term $search_exploded = explode(" ",$search); foreach($search_exploded as $search_each) { //construct query $x++; if ($x==1) $construct .= "username LIKE '%$search_each%'"; else $construct .= " OR username LIKE '%$search_each%'"; } //echo out construct $construct = "SELECT * FROM members WHERE $construct"; $run = mysql_query($construct); $foundnum = mysql_num_rows($run); if ($foundnum==0) echo "You searched for <b>$search</b>. No results found."; else { echo "You searched for <b>$search</b><br>$foundnum result(s) found!<p><hr size='1' width='387'color='#E6E6E6'>"; while ($runrows = mysql_fetch_assoc($run)) { //get data $state = ucwords($runrows['state']); $url = $runrows['url']; $username = ucwords($runrows['username']); $imagelocation = $runrows['imagelocation']; if ($imagelocation == "") { $imagelocation = "./profileimages/noprofilepic.jpg"; } echo " <img src ='$imagelocation' width='100' height='105' border='0' align='left' style='padding-right:10px'><br> <b>$username</b><br> $state<br> <a href='$url'>View Profile</a><br><br><br> <hr size='1' width='387' align='left' color='#E6E6E6'> "; } } } } ?> </font>
  6. the latest script doesnt work (does not overwrite the image in FTP) and i do not know how to change it
  7. this is how i am viewing the image but the old image still didnt get deleted from FTP <?php session_start(); include("checklogin.php"); $username = $_SESSION['myusername']; $query = mysql_query("SELECT * FROM members WHERE username='$username'"); if (mysql_num_rows($query)==0){ die("User not found!"); }else{ $row = mysql_fetch_assoc($query); $location = $row['imagelocation']; if($location == ""){ echo "<img src ='/profileimages/box.png' width='225' height='275' border='0'></a>"; }else{ echo "<img src ='$location' width='225' height='275' border='0'>"; } } ?>
  8. error <?php session_start(); include("checklogin.php"); $_SESSION['myusername']; $username = $_SESSION['myusername']; if($_FILES['myfile']['name']!=""){ //this means user has browsed for new picture to upload $old_picture_path="/images/user1.jpg"; //change your path unlink($old_picture_path); //then do upload of new picture and update database with new picture location } //get file attributes $name = $_FILES['myfile']['name']; $tmp_name = $_FILES['myfile']['tmp_name']; if ($name) { //start upload process $location = "./profileimages/$name"; move_uploaded_file($tmp_name,$location); $query = mysql_query("UPDATE members SET imagelocation='$location' WHERE username='$username'") or die(mysql_error()); die("Your profile picture have been upload! <a href='profile.php'>Profile</a>"); } else die("Please select a file!"); } echo "Welcome, ".ucwords(strtolower($_SESSION['myusername']))."!<p>"; echo "Upload your image: <form action='upload.php' method='POST' enctype='multipart/form-data'> File: <input type='file' name='myfile'> <input type='submit' name='submit' value='Upload'> </form> "; ?>
  9. i cant get my head around this one, im quite new to php
  10. so it would be something like, if $_POST == $location then continue else $old_picture_path="/images/user1.jpg"; unlink($old_picture_path); ??
  11. do i insert that before, "//get file attributes"?
  12. i have no idea how to do that
  13. This script is for uploading profile pictures and it works perfectly but when i want to change my current profile picture it doesnt overwrite my image in FTP but does overwrite it in my database, ive tried everything but nothing seems to work, please help. <?php session_start(); include("checklogin.php"); $_SESSION['myusername']; $username = $_SESSION['myusername']; if ($_POST['submit']) { //get file attributes $name = $_FILES['myfile']['name']; $tmp_name = $_FILES['myfile']['tmp_name']; if ($name) { //start upload process $location = "./profileimages/$name"; move_uploaded_file($tmp_name,$location); $query = mysql_query("UPDATE members SET imagelocation='$location' WHERE username='$username'") or die(mysql_error()); die("Your profile picture have been upload! <a href='profile.php'>Profile</a>"); } else die("Please select a file!"); } echo "Welcome, ".ucwords(strtolower($_SESSION['myusername']))."!<p>"; echo "Upload your image: <form action='upload.php' method='POST' enctype='multipart/form-data'> File: <input type='file' name='myfile'> <input type='submit' name='submit' value='Upload'> </form> "; ?>
  14. what is the code to add it on or take it off on text i dont have a clue, ive look everywhere
  15. firstly, how can I set 10 results per page?
  16. I would like to just show 10 results per page but how do I do this, and how do I create the pages? <font face="arial"> <?php //get data $button = $_GET['submit']; $search = $_GET['search']; if (!$button) header("location:unititled.php"); else { if (strlen($search)<3) header("location:unititled.php"); else { echo ""; //connect to our database mysql_connect("localhost","",""); mysql_select_db(""); //explode our search term $search_exploded = explode(" ",$search); foreach($search_exploded as $search_each) { //construct query $x++; if ($x==1) $construct .= "username LIKE '%$search_each%'"; else $construct .= " OR username LIKE '%$search_each%'"; } //echo out construct $construct = "SELECT * FROM members WHERE $construct"; $run = mysql_query($construct); $foundnum = mysql_num_rows($run); if ($foundnum==0) echo "No results found."; else { echo "You searched for <b>$search</b><br>$foundnum result(s) found!<p><hr size='1' width='300'color='#E6E6E6'>"; while ($runrows = mysql_fetch_assoc($run)) { //get data $state = ucwords($runrows['state']); $url = $runrows['url']; $username = ucwords($runrows['username']); $imagelocation = $runrows['imagelocation']; if ($imagelocation == "") { $imagelocation = "./profileimages/box.png"; } echo " <img src ='$imagelocation' width='100' height='105' border='0' align='left' style='padding-right:10px'><br> <b>$username</b><br> $state<br> <a href='$url'>View Profile</a><br><br><br> <hr size='1' width='300' align='left' color='#E6E6E6'> "; } } } } ?> </font>
  17. if my database cannot find a member profile picture how can i echo a different picture? <font face="arial"> <?php //get data $button = $_GET['submit']; $search = $_GET['search']; if (!$button) header("location:unititled.php"); else { if (strlen($search)<3) header("location:unititled.php"); else { echo ""; //connect to our database mysql_connect("localhost","",""); mysql_select_db(""); //explode our search term $search_exploded = explode(" ",$search); foreach($search_exploded as $search_each) { //construct query $x++; if ($x==1) $construct .= "username LIKE '%$search_each%'"; else $construct .= " OR username LIKE '%$search_each%'"; } //echo out construct $construct = "SELECT * FROM members WHERE $construct"; $run = mysql_query($construct); $foundnum = mysql_num_rows($run); if ($foundnum==0) echo "No results found."; else { echo "You searched for <b>$search</b><br>$foundnum result(s) found!<p><hr size='1'>"; while ($runrows = mysql_fetch_assoc($run)) { //get data $state = ucwords($runrows['state']); $url = $runrows['url']; $username = ucwords($runrows['username']); $imagelocation = $runrows['imagelocation']; echo " <img src ='$imagelocation' width='100' height='110' border='0' align='left' style='padding-right:10px'><br> <b>$username</b><br> $state<br> <a href='$url'>View Profile</a><br><br><br> <hr size='1' width='300' align='left'> "; } } } } ?> </font> the profile pictures are in ['imagelocation']
  18. i never knew aligning could be this hard
  19. i cannot seem to move my text very much i want to be able to have the text right of the image but i cant do it, you will understand when you view the link http://www.squiblo.com/results.php?search=admin+liam&submit=Search <font face="arial"> <?php //get data $button = $_GET['submit']; $search = $_GET['search']; if (!$button) header("location:unititled.php"); else { if (strlen($search)<3) header("location:unititled.php"); else { echo ""; //connect to our database mysql_connect("localhost","",""); mysql_select_db(""); //explode our search term $search_exploded = explode(" ",$search); foreach($search_exploded as $search_each) { //construct query $x++; if ($x==1) $construct .= "username LIKE '%$search_each%'"; else $construct .= " OR username LIKE '%$search_each%'"; } //echo out construct $construct = "SELECT * FROM members WHERE $construct"; $run = mysql_query($construct); $foundnum = mysql_num_rows($run); if ($foundnum==0) echo "No results found."; else { echo "You searched for <b>$search</b><br>$foundnum result(s) found!<p><hr size='1'>"; while ($runrows = mysql_fetch_assoc($run)) { //get data $state = ucwords($runrows['state']); $url = $runrows['url']; $username = ucwords($runrows['username']); $imagelocation = $runrows['imagelocation']; echo " <img src ='$imagelocation' width='100' height='100' border='0'> &#38;#32;<b>$username</b><br> $state<br> <a href='$url'>View Profile</a> <hr size='1' width='300' align='left'> "; } } } } ?> </font>
  20. squiblo

    text align

    please delete this post, wrong section, ill create again in php help
  21. squiblo

    text align

    i cannot set the information to the right of the image, i cant move it much, you might understand when you view the link. http://www.squiblo.com/results.php?search=admin+liam&submit=Search <font face="arial"> <?php //get data $button = $_GET['submit']; $search = $_GET['search']; if (!$button) header("location:unititled.php"); else { if (strlen($search)<3) header("location:unititled.php"); else { echo ""; //connect to our database mysql_connect("localhost","",""); mysql_select_db(""); //explode our search term $search_exploded = explode(" ",$search); foreach($search_exploded as $search_each) { //construct query $x++; if ($x==1) $construct .= "username LIKE '%$search_each%'"; else $construct .= " OR username LIKE '%$search_each%'"; } //echo out construct $construct = "SELECT * FROM members WHERE $construct"; $run = mysql_query($construct); $foundnum = mysql_num_rows($run); if ($foundnum==0) echo "No results found."; else { echo "You searched for <b>$search</b><br>$foundnum result(s) found!<p><hr size='1'>"; while ($runrows = mysql_fetch_assoc($run)) { //get data $state = ucwords($runrows['state']); $url = $runrows['url']; $username = ucwords($runrows['username']); $imagelocation = $runrows['imagelocation']; echo " <img src ='$imagelocation' width='100' height='100' border='0'> &#32;<b>$username</b><br> $state<br> <a href='$url'>View Profile</a> <hr size='1' width='300' align='left'> "; } } } } ?> </font>
  22. i get an error with this... echo " <b>$username</b><br> $state<br> <a href='$url'>View Profile</a><br><br> "; header("Content-type:image/jpeg"); <img src ="$imagelocation" width='100' height='100' border='0'/> how can i find out what line the error is on?
×
×
  • 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.