Jump to content

squiblo

Members
  • Posts

    483
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by squiblo

  1. it is now working guys, i was just resending the data but i should have been refreshing the login page, thank you
  2. still getting a black screen... :shrug: <form name="form1" method="POST" action="checklogin.php"> <input type="text" id="myusername" name="myusername" style="font-size:15px;"><br><br> <input type="text" id="mycompany" name="mycompany" style="font-size:15px;"><br><br> <input type="password" id="mypassword" name="mypassword" style="font-size:15px;"><br><br> <input type="submit" id="Login" name="Login" value="Log In" style="height:35px;"> </form> <?php error_reporting(E_ALL); ini_set('display_errors', 'on'); $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name=""; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); if(isset($_POST['Login'])){ // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $mycompany=$_POST['mycompany']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $mycompany = stripslashes($mycompany); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $mycompany = mysql_real_escape_string($mycompany); //$_SESSION['myusername']=$dbusername; $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword' and company='$mycompany'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword and $mycompany, table row must be 1 row if($count==1){ $_SESSION['myusername'] = $myusername; $_SESSION['mypassword'] = $mypassword; $_SESSION['mycompany'] = $mycompany; header("location:about.php"); } else { echo 'User is NOT logged in'; } } ?>
  3. i am still getting a blank page with this... <?php error_reporting(E_ALL); ini_set('display_errors', 'on'); $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name=""; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); if(isset($_POST['Login'])){ // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $mycompany=$_POST['mycompany']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $mycompany = stripslashes($mycompany); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $mycompany = mysql_real_escape_string($mycompany); //$_SESSION['myusername']=$dbusername; $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword' and company='$mycompany'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword and $mycompany, table row must be 1 row if($count==1){ $_SESSION['myusername'] = $myusername; $_SESSION['mypassword'] = $mypassword; $_SESSION['mycompany'] = $mycompany; echo 'User is logged in'; } else { echo 'User is NOT logged in'; } } ?>
  4. i am just getting a blank page, what does it mean if i am getting a blank page and it is failing?
  5. i change the id to "Login" but still not working
  6. i think i see it now, should my id for the submit button on the form be changed to "Login"?
  7. ok im still getting an error, this is my newest code.. <?php $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name=""; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); if(isset($_POST['Login'])){ // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $mycompany=$_POST['mycompany']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $mycompany = stripslashes($mycompany); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $mycompany = mysql_real_escape_string($mycompany); //$_SESSION['myusername']=$dbusername; $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword' and company='$mycompany'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword and $mycompany, table row must be 1 row if($count==1){ $_SESSION['myusername'] = $myusername; $_SESSION['mypassword'] = $mypassword; $_SESSION['mycompany'] = $mycompany; echo 'User is logged in'; } else { echo 'User is NOT logged in'; } } ?> and this is my html form... <form name="form1" method="post" action="checklogin.php"> <input type="text" id="myusername" style="font-size:15px;"><br><br> <input type="text" id="mycompany" style="font-size:15px;"><br><br> <input type="password" id="mypassword" style="font-size:15px;"><br><br> <input type="submit" id="indexsearch" name="log in" value="Log In" style="height:35px;"> </form>
  8. so it is this?... if($count==1){ $_SESSION['myusername'] = $myusername; $_SESSION['mypassword'] = $mypassword; $_SESSION['mycompany'] = $mycompany; echo 'User is logged in'; } else { echo 'User is NOT logged in'; }
  9. this is my code that gets the info from the database but something is wrong, it goes not redirect me to either google or yahoo if my loggin details are correct or not, can anyone help me find the problem please... <?php $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name=""; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); if(isset($_POST['Login'])){ // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $mycompany=$_POST['mycompany']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $mycompany = stripslashes($mycompany); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $mycompany = mysql_real_escape_string($mycompany); //$_SESSION['myusername']=$dbusername; $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword' and company='$mycompany'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword and $mycompany, table row must be 1 row if($count==1){ // Register $myusername, $mycompany and $mypassword and redirect to file "profile.php" session_register("myusername"); session_register("mypassword"); session_register("mycompany"); header("location:http://www.yahoo.com"); } else { header("location: http://www.google.com"); } } ?>
  10. Hi, I was wondering if it is possible to code a website so that it can only be viewed in Firefox and if any other browser are being used it will echo and error, can this be done? and how?
  11. ive tried to set a background but i would like more than one image how can i do this? i have tried this... body { background:#E6E6E6; background-image:url('/images/body_img.jpg'); background-repeat:no-repeat; background-attachment:fixed; background-position:50% 70%; } body { background:#E6E6E6; background-image:url('/images/header_img.jpg'); background-repeat:no-repeat; background-attachment:fixed; background-position:top center; } but doesnt work, it only shows one image, what is the right way of doing this?
  12. squiblo

    Backgrounds

    if you dont understand please say
  13. squiblo

    Backgrounds

    Im sure this is simple to do but I dont have a clue about CSS, at the moment part of my background is an image but is jusat taking up space, so how could i get this..."http://www.squiblo.com/about.php" to look more like this..."http://www.squiblo.com/terms.php" but with the body image as a background and not an individual image that just looks like a background. this is the page script for /about.php... <?php session_start(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Squiblo - About Us!</title> <style type="text/css"> div#container { width: 900px; position: relative; margin-top: 0px; margin-left: auto; margin-right: auto; text-align: left; } body { text-align: center; margin: 0; } body { background-image: url(http://www.squiblo.com/Images/body_img.jpg); background-repeat: repeat-x; } </style> </head> <body bgcolor="#E6E6E6" text="#FFFFFF"> <div id="container"> <div id="wb_Shape1" style="position:absolute;left:55px;top:41px;width:792px;height:125px;z-index:2" align="center"> <img src="/Images/header_img.jpg" id="Shape1" align="top" alt="" title="" border="0" width="792" height="125"></div> <div id="wb_Text1" style="position:absolute;left:60px;top:85px;width:325px;height:72px;z-index:3" align="left"> <font style="font-size:70px" color="#FFFFFF" face="impact"><a href="/index.php" style="text-decoration:none"> <font color="#FFFFFF">SQUIBLO</a></font></font></div> <?php echo '<div id="wb_Shape2" style="position:absolute;left:54px;width:793px;height:412px;z-index:10;'; if(isset($_SESSION['myusername'])) { echo 'top:200px;'; } else { echo 'top:170px;'; } echo '" align="center"> <img src="/Images/body_img.jpg" id="Shape2" align="top" alt="" title="" border="0" width="793" height="412"></div>'; ?> <div id="menubar" style="position:absolute;left:54px;top:168px;width:793px;height:30px;z-index:13" align="center"> <?php if(isset($_SESSION['myusername'])) echo '<img src="/Images/header_img.jpg" id="menubar" align="top" alt="" title="" border="0" width="793" height="30">'; ?> </div> <?php if($_SESSION['myusername']){ ?> <div id="wb_Text1" style="position:absolute;left:684px;top:55px;width:151px;height:14px;z-index:7" align="right"> <font style="font-size:13px" color="#FFFFFF" face="Arial">You are logged in as:</font><br> <font style="font-size:15px" color="#FF0000" face="Arial"> <?php echo ucwords(strtolower($_SESSION['myusername'])); ?> </font></div> <div id="logout" style="position:absolute;left:775px;top:130px;width:64px;height:23px;z-index:12" align="center"><a href="/logout.php"> <?php echo '<img src="/Images/logout.png" id="logout" align="top" alt="logout" title="" border="0" width="64" height="23">'; ?> </a></div> <div id="apps" style="position:absolute;left:754px;top:169px;z-index:14" align="center"> <?php include 'accmenu.php'; ?> </div> <div id="wb_Text3" style="position:absolute;left:60px;top:173px;width:100px;height:30px;z-index:14" align="left"> <font style="font-size:17px" color="#FFFFFF" face="Arial"><a href="/index.php" style="text-decoration:none"><font color="#FFFFFF">Profile</a></font></font></div> <div id="wb_Text4" style="position:absolute;left:123px;top:173px;width:100px;height:30px;z-index:14" align="left"> <font style="font-size:17px" color="#FFFFFF" face="Arial"><a href="http://google.com" style="text-decoration:none"><font color="#FFFFFF">Friends</a></font></font></div> <div id="wb_Text5" style="position:absolute;left:195px;top:173px;width:100px;height:30px;z-index:14" align="left"> <font style="font-size:17px" color="#FFFFFF" face="Arial"><a href="http://google.com" style="text-decoration:none"><font color="#FFFFFF">Photos</a></font></font></div> <div id="wb_Text6" style="position:absolute;left:262px;top:173px;width:100px;height:30px;z-index:14" align="left"> <font style="font-size:17px" color="#FFFFFF" face="Arial"><a href="http://google.com" style="text-decoration:none"><font color="#FFFFFF">Mail</a></font></font></div> <div id="wb_Text7" style="position:absolute;left:610px;top:173px;width:100px;height:30px;z-index:14" align="left"> <font style="font-size:17px" color="#FFFFFF" face="Arial"><a href="http://google.com" style="text-decoration:none"><font color="#FFFFFF">Search</a></font></font></div> <div id="wb_Text8" style="position:absolute;left:680px;top:173px;width:100px;height:30px;z-index:14" align="left"> <font style="font-size:17px" color="#FFFFFF" face="Arial"><a href="http://google.com" style="text-decoration:none"><font color="#FFFFFF">Settings</a></font></font></div> <?php } else { ?> <form name="form1" method="post" action="checklogin.php"> <input type="text" id="myusername" style="position:absolute;left:651px;top:59px;width:174px;font-family:Arial;font-size:13px;z-index:4" size="29" name="myusername" value="" title="username"> <input type="password" id="mypassword" style="position:absolute;left:651px;top:86px;width:174px;font-family:Arial;font-size:13px;z-index:5" size="29" name="mypassword" value="" tabindex="password" title="password"> <input type="checkbox" id="Checkbox1" name="Checkbox1" value="on" style="position:absolute;left:648px;top:113px;font-family:Arial;font-size:13px;z-index:6"> <input type="submit" id="Button1" name="Login" value="Login" style="position:absolute;left:778px;top:117px;width:50px;height:43px;font-family:Arial;font-size:13px;z-index:8" title="Login"> </form> <div id="wb_Text7" style="position:absolute;left:584px;top:63px;width:47px;height:16px;z-index:22" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Username:</font></div> <div id="wb_Text8" style="position:absolute;left:586px;top:88px;width:65px;height:16px;z-index:23" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial">Password:</font></div> <div id="wb_Text2" style="position:absolute;left:669px;top:113px;width:111px;height:14px;z-index:7" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Remember Me</font></div> <div id="wb_Text3" style="position:absolute;left:651px;top:131px;width:122px;height:14px;z-index:9" align="left"> <font style="font-size:11px" color="#FFFFFF" face="Arial">Forgot your password?</font></div> <?php } ?> <?php if($_SESSION['myusername']){ ?> <div id="copyright" style="position:absolute;left:55px;top:618px;width:150px;height:44px;z-index:32" align="left"> <font style="font-size:13px" color="#000000" face="Arial">Squiblo &#169; 2009 </font></div> <?php } else { ?> <div id="copyright" style="position:absolute;left:55px;top:588px;width:150px;height:44px;z-index:32" align="left"> <font style="font-size:13px" color="#000000" face="Arial">Squiblo &#169; 2009</font></div> <?php } ?> <?php if($_SESSION['myusername']){ ?> <div id="about" style="position:absolute;left:185px;top:618px;width:150px;height:44px;z-index:33" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/about.php" style="text-decoration:none"><font color=#000000>About Us </font></a></font></div> <?php } else { ?> <div id="about" style="position:absolute;left:185px;top:588px;width:150px;height:44px;z-index:33" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/about.php" style="text-decoration:none"><font color=#000000>About Us</font></a></font></div> <?php } ?> <?php if($_SESSION['myusername']){ ?> <div id="terms" style="position:absolute;left:285px;top:618px;width:150px;height:44px;z-index:34" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/terms.php" style="text-decoration:none"><font color=#000000>Terms and Conditions </font></a></font></div> <?php } else { ?> <div id="terms" style="position:absolute;left:285px;top:588px;width:150px;height:44px;z-index:34" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/terms.php" style="text-decoration:none"><font color=#000000>Terms and Conditions</font></a></font></div> <?php } ?> <?php if($_SESSION['myusername']){ ?> <div id="contact" style="position:absolute;left:450px;top:618px;width:150px;height:44px;z-index:35" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/contact.php" style="text-decoration:none"><font color=#000000>Contact Us </font></a></font></div> <?php } else { ?> <div id="contact" style="position:absolute;left:450px;top:588px;width:150px;height:44px;z-index:35" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/contact.php" style="text-decoration:none"><font color=#000000>Contact Us</font></a></font></div> <?php } ?> <?php if($_SESSION['myusername']){ ?> <div id="privacy" style="position:absolute;left:555px;top:618px;width:150px;height:44px;z-index:36" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/privacy.php" style="text-decoration:none"><font color=#000000>Privacy </font></a></font></div> <?php } else { ?> <div id="privacy" style="position:absolute;left:555px;top:588px;width:150px;height:44px;z-index:36" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/privacy.php" style="text-decoration:none"><font color=#000000>Privacy</font></a></font></div> <?php } ?> <?php if($_SESSION['myusername']){ ?> <div id="help" style="position:absolute;left:640px;top:618px;width:150px;height:44px;z-index:36" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/help.php" style="text-decoration:none"><font color=#000000>Help </font></a></font></div> <?php } else { ?> <div id="help" style="position:absolute;left:640px;top:588px;width:150px;height:44px;z-index:36" align="left"> <font style="font-size:13px" color="#000000" face="Arial"><a href="/help.php" style="text-decoration:none"><font color=#000000>Help</font></a></font></div> <?php } ?> </div> </body> </html>
  14. i have just noticed that the image size changes depending on the amount of characters entered into the search but the image size should change depending on the amound of results on the page
  15. that works but now if there is more than 3 results the image height stays the same at 500px
  16. not too sure whatr you mean either sorry, i'm not sure which part to move
  17. I have 1 problem with my searching, if I search for anything that is less that 3 characters long, it echos "your search must be more that 3 characters long" but also it will echo "You searched for L. 1 result(s) found". and it will show the results with the letter L in it <?php $search = $_GET['search']; if(strlen($search)<3) { echo "Your search must be at least 3 characters long."; $div_height = 'height:500px;'; $img_height = 'height="500"'; } else { $div_height = 'height:1200px;'; $img_height = 'height="1200"'; } ?> <div id="wb_Shape2" style="position:absolute;top:-60px;left:-15px;<?php echo $div_height; ?>width:793px;z-index:-1;" align="center"> <img src="/Images/body_img.jpg" id="Shape2" align="top" alt="" title="" border="0"<?php echo $img_height; ?> width="793"> </div> <?php //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'> "; } } ?>
  18. squiblo

    postitioning

    http://www.squiblo.com/results.php the large blue box isnt where i expected as you may have noticed, will somebody put it in the correct place for me please or guide me to do it, i do not understand CSS. <div id="results" style="position:absolute;left:70px;top:260px;z-index:16"> <font face="arial"> <?php $search = $_GET['search']; if(strlen($search)<3) { echo "Your search must be at least 3 characters long."; $div_height = 'height:500px;'; $img_height = 'height="500"'; } else { $div_height = 'height:1200px;'; $img_height = 'height="1200"'; } ?> <div id="wb_Shape2" style="position:absolute;top:200px;left:54px;<?php echo $div_height; ?>width:793px;z-index:-1;" align="center"> <img src="/Images/body_img.jpg" id="Shape2" align="top" alt="" title="" border="0"<?php echo $img_height; ?> width="793"> </div> <?php //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> </div> and yes i ment "positioning"
  19. http://www.squiblo.com/results.php how can i positition the large blue box correctly? <div id="results" style="position:absolute;left:70px;top:260px;z-index:16"> <font face="arial"> <?php $search = $_GET['search']; if(strlen($search)<3) { echo "Your search must be at least 3 characters long."; $div_height = 'height:500px;'; $img_height = 'height="500"'; } else { $div_height = 'height:1200px;'; $img_height = 'height="1200"'; } ?> <div id="wb_Shape2" style="position:absolute;top:200px;left:54px;<?php echo $div_height; ?>width:793px;z-index:-1;" align="center"> <img src="/Images/body_img.jpg" id="Shape2" align="top" alt="" title="" border="0"<?php echo $img_height; ?> width="793"> </div> <?php //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> </div>
  20. <div id="results" style="position:absolute;left:70px;top:260px;z-index:16"> <font face="arial"> <?php $search = $_GET['search']; if(strlen($search)<3) { echo "Your search must be at least 3 characters long."; $div_height = 'height:500px;'; $img_height = 'height="500"'; } else { $div_height = 'height:1200px;'; $img_height = 'height="1200"'; } ?> <div id="wb_Shape2" style="position:absolute;top:200px;left:54px;<?php echo $div_height; ?>width:793px;z-index:-1;" align="center"> <img src="/Images/body_img.jpg" id="Shape2" align="top" alt="" title="" border="0"<?php echo $img_height; ?> width="793"> </div> <?php //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> </div>
  21. the resizing is now working but the position isnt how i expected. http://www.squiblo.com/results.php
  22. yes i mean the blue box, would something like this work? if(strlen($search)<3) { echo "Your search must be at least 3 characters long."; $div_height = 'height:500px;'; $img_height = 'height="500"'; } else { $div_height = 'height:1200px;'; $img_height = 'height="1200"'; } ?> <div id="wb_Shape2" style="position:absolute;top:200px;left:54px;<?php echo $div_height; ?>width:793px;z-index:10;" align="center"> <img src="/Images/body_img.jpg" id="Shape2" align="top" alt="" title="" border="0" ;<?php echo $img_height; ?> width="793" > </div>
  23. after that the image and results are showing, but the size of the image is not changing
  24. http://www.squiblo.com/results.php
  25. ive just moved a few things around but this code is not showing on the page <?php if (!isset($_GET['button'])) { header("location:advsearch.php"); exit; } $search = $_GET['search']; if(strlen($search)<3) { echo "Your search must be at least 3 characters long."; $div_height = 'height:500px;'; } else { $div_height = 'height:1200px;'; } ?> <div id="wb_Shape2" style="position:absolute;top:200px;left:54px;<?php echo $div_height; ?>width:793px;z-index:10;" align="center"> <img src="/Images/body_img.jpg" id="Shape2" align="top" alt="" title="" border="0" width="793"> </div> <?php //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'> "; } } ?>
×
×
  • 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.