PHP - Php Page Taking Time To Load A Register
hi! i dont know if the query below from mysql is slowing down the page or i have not written it properly:
It is very slow, even when you limit the results to 100 . Thanks in advance.. Code: [Select] SELECT `tbl_business`.`appformno`, " _ & "`tbl_business`.`pobox`, `tbl_business`.`plotno`, `tbl_business`.`postalcode`, " _ & "`tbl_business`.`zonecode`, `tbl_business`.`ne`, `tbl_activities`.`act_code`, " _ & "`tbl_activity_codes`.`approved_fee`, `tbl_payment_status`.`status`, " _ & "`tbl_business`.`company`, `tbl_activity_codes`.`description` " _ & "FROM (`citycouncil`.`tbl_activity_codes` `tbl_activity_codes` " _ & "LEFT JOIN (`citycouncil`.`tbl_business` `tbl_business` " _ & "LEFT JOIN `citycouncil`.`tbl_activities` `tbl_activities` " _ & "ON `tbl_business`.`appformno`=`tbl_activities`.`appformno`) " _ & "ON `tbl_activity_codes`.`act_code`=`tbl_activities`.`act_code`) " _ & "LEFT JOIN `citycouncil`.`tbl_payment_status` `tbl_payment_status` " _ & "ON `tbl_activities`.`id`=`tbl_payment_status`.`activity_id` " _ & "WHERE tbl_business.appformno LIKE '%" & strFormNo & "%' " _ & "AND tbl_business.bid LIKE '%" & strBizIdNo & "%'" _ & " AND `tbl_business`.`contperson` LIKE '%" & strContPerson & "%' " _ & "AND `tbl_business`.`zonecode` LIKE '%" & strZoneCode & "%' " _ & " AND `tbl_activities`.`act_code` LIKE '%" & strBizActCode & "%' " _ & "AND `tbl_business`.`roadstreet` LIKE '%" & strStreet & "%' " _ & " AND `tbl_business`.`company` LIKE '%" & strBizName & "%' " _ & "AND `tbl_business`.`building` LIKE '%" & strBuilding & "%' " _ & "ORDER BY `tbl_business`.`appformno` Similar TutorialsHey, I need to generate a script which tells me how long it takes for an external page to load... Please can you help? Thanks hello, i want to get into a particular page if the user stays more than lets say 20 minutes to automatically load another php page. More specific i have a page which is a test. The user answears to some multiple choice questions. i want him to have only a particular time to anwear. Lets say after 20 min i want to load the results page. Any ideas? Hi Guys and Gals, I run a simple fansite for some of my fellow MTG Tactics players at www.onlinegamekey.com I recently made a Booster Page value page he http://www.onlinegamekey.com/booster-packs.php And it seems the page loads really slow, but I kind of understand that since its doing a lot of math and dealing with a lot of data. I am wondering if there is a way to possibly optimize the page and querys in such a way that it doesn't take so long to load. I'm basically using 4 queries to get the value of each pack and 1 function to average the query data. And I add them up as I go. This is my function to find average values Code: [Select] ///AVERAGE FUNCTION function calculate_average($arr) { $count = count($arr); //total numbers in array foreach ($arr as $value) { $total = $total + $value; // total value of array numbers } $average = ($total/$count); // get average value return $average; } These are the queries to get the Average Values Code: [Select] <?php ///SETTING THE DAY $today = date("Y/m/d"); ///ALTERING DAY QUERY TIME (20 Days of Data) $minusday = mktime(0,0,0,date("m"),date("d")-20,date("Y")); ///SETTING THE DAY FOR THE QUERIES $queryday = date("Y/m/d",$minusday); ///DATA SET FOR BOOSTER PACK 1 //GET THE MYTHIC AVERAGE VALUE $sqlMythic=mysql_query("SELECT AVG( ab.Price_Per ) AS Aaverage FROM auctions AS ab INNER JOIN cardlist AS c ON c.card_name = ab.Card_Name WHERE ab.Day >= '$queryday' AND c.rarity = 'Mythic Rare' AND c.set = '1' GROUP BY c.card_name, ab.Card_Name") or die; while ($row=mysql_fetch_array($sqlMythic)) { $MythicValues[]=$row['Aaverage']; } ///MYTHIC VALUE IS 10% OF AVERAGE VALUE $Mythic = calculate_average($MythicValues) * .1; //GET THE RARE AVERAGE VALUE $sqlRare=mysql_query("SELECT AVG( ab.Price_Per ) AS Aaverage FROM auctions AS ab INNER JOIN cardlist AS c ON c.card_name = ab.Card_Name WHERE ab.Day >= '$queryday' AND c.rarity = 'Rare' AND c.set='1' GROUP BY c.card_name, ab.Card_Name") or die; while ($row=mysql_fetch_array($sqlRare)) { $RareValues[]=$row['Aaverage']; } ///RARE VALUE IS 90% OF AVERAGE RARE VALUE $Rare = calculate_average($RareValues) *.9; ///TOTAL CONTRIBUTION TO PACK 100% IS 10% MYTHIC + 90% RARE $raremythic= $Mythic + $Rare; ///GET THE UNCOMMON AVERAGE VALUE $sqlUncommon=mysql_query("SELECT AVG( ab.Price_Per ) AS Aaverage FROM auctions AS ab INNER JOIN cardlist AS c ON c.card_name = ab.Card_Name WHERE ab.Day >= '$queryday' AND c.rarity = 'Uncommon' AND c.set='1' GROUP BY c.card_name, ab.Card_Name") or die; while ($row=mysql_fetch_array($sqlUncommon)) { $ucValues[]=$row['Aaverage']; } ///UNCOMMON VALUE IS VALUE * 3 $Uncommon = calculate_average($ucValues); $urm= ($Uncommon * 3) + $raremythic; ///GET THE COMMON VALUE $sqlCommon=mysql_query("SELECT AVG( ab.Price_Per ) AS Aaverage FROM auctions AS ab INNER JOIN cardlist AS c ON c.card_name = ab.Card_Name WHERE ab.Day >= '$queryday' AND c.rarity = 'Common' AND c.set='1' GROUP BY c.card_name, ab.Card_Name") or die; while ($row=mysql_fetch_array($sqlCommon)) { $cValues[]=$row['Aaverage']; } ///COMMON VALUE IS VALUE * 10 $common = calculate_average($cValues); //TOTAL SET 1 VALUE IS ALL VALUES ADDED UP $curm= ($common * 10) + $urm; ?> But I'm not real sure where the strain is coming from. The page seems to load really slow, and I'm not sure if I should just try and write all these queries as a separate function then have it write the data to a separate table, or if there is another way to optimize this code. I'm still have a lot to learn so I would appreciate any thoughts or ideas you folks can offer me. Many thanks hiii all, i want to show the database field (alise name) as the url after index.php when page or site loads first time. how i can achieve it? please help.... thanks in advance Hi. Me next question, is how to I send variable from one page to another page. Example: Form Page checks user inputed values, updates database then uses // Thank you Page $insertGoTo = "changepass.php"; header(sprintf("Location: %s", $insertGoTo)); to redirect users to Confirmation page. Confirmation page: Checks to make sure values where properly stored in datebase and says "YES IT WORKED" OR "NO, SOMETHING WENT WRONG" Current Code: <?php session_start(); ?> <?php $submit = $_POST['submit']; // Form Data $email = $_POST['email']; $password_old = $_POST['password_old']; $password_new = $_POST['password_new']; $password_new_con = $_POST['password_new_con']; $errorcount = 0; // Edit anything inbetween the " " for the display error message $errormsg['Email'] = "Email Entered is not in our database"; $errormsg['OldPass'] = "Old Password Entered is Incorrect. Please check your Email"; $errormsg['NewPass'] = "New Password must be between 6 and 32 characters"; $errormsg['NewPassCon'] = "New Passwords do not match."; $errormsg['SecCode'] = "Security Code is Invalid"; $errormsg['dbPass'] = "Invalide Email or activation code. Please Contact <a href='mailto:webmaster@fusionfashionhair.com?subject=Fusion Fashion Hair - Member Activation Error%20Request'>Admin</a>"; $errormsg['NoErr'] = "No Errors, Continue"; $errormsg['PlaceHold'] = ""; $errortrack[] = $errormsg['PlaceHold']; if ($_POST[submit]){ if ($errorstop = "go") { $errorstop="go"; while ($errorstop<>"stop") { //Check for security code if ($_SESSION[key]==$_POST[user_code]){ // echo "True - Continue 0"; // echo "<p>----------</p>"; $_SESSION[key]=''; } else { // echo "False - Stop 0"; $errortrack[] = $errormsg['SecCode']; $errorcount++; $errorstop="stop"; } // check for existance if (!checkEmail($email)) { // echo "False - Stop 1"; $errortrack[] = $errormsg['Email']; $errorcount++; $errorstop="stop"; } else { // echo "True - Continue 1"; // echo "<p>----------</p>"; } // check for existance if (strlen($password_old)>5) { // echo "True - Continue 2"; // echo "<p>----------</p>"; } else { // echo "False - Stop 2"; $errortrack[] = $errormsg['OldPass']; $errorcount++; $errorstop="stop"; } // check for existance if (strlen($password_new)>32||strlen($password_new)<6) { // echo "False - Stop 3"; $errortrack[] = $errormsg['NewPass']; $errorcount++; $errorstop="stop"; } else { // echo "True - Continue 3"; // echo "<p>----------</p>"; } // check for existance if ($password_new_con==$password_new) { // echo "True - Continue 4"; // echo "<p>----------</p>"; $errorstop="stop";//Get Out of loop } else { // echo "False - Stop 4"; $errortrack[] = $errormsg['NewPassCon']; $errorcount++; $errorstop="stop"; } }//End While Loop // Check database require('dbConfig.php'); // Encrypts old password to check with Database Encryped Password $password_old = md5($password_old); $check = mysql_query("SELECT * FROM {$usertable} WHERE email='$email' AND password='$password_old'"); $checknum = mysql_num_rows($check); if ($checknum==1) { // echo "True - Continue 5 Set password"; // echo "<p>----------</p>"; // Encrypts new password $password = md5($password_new); //run a query to update the account $acti = mysql_query("UPDATE {$usertable} SET password='$password' WHERE email='$email'"); } else { // echo "False - Stop 5"; $errortrack[] = $errormsg['dbPass']; $errorcount++; $errorstop="stop"; }//End if checknum // echo "True - Continue 6 GO TO HEADER PAGE"; // Thank you Page $insertGoTo = "changepass.php"; header(sprintf("Location: %s", $insertGoTo)); } else { while($errorcount>=0) { // Test display all error messages // echo "<p>----------</p>"; // echo "<p>Error Count = '$errorcount'</p>"; } die ("PLEASE FILL IN ALL FIELDS"); } } ?> <?php // LINUX PLATFORM OPTION 3 // checkEmail function checks standard email format same as preg_match() // checkEmail function checks DSN records using checkdnsrr Use list() to seperate name and domain using split function // checkdnsrr ONLY WORKS on LINUX PLATFORM // Check to see if domain and username is active // uses fsockopen() to check if its in use using port 25 function checkEmail($email) { // checks proper syntax if(preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/" , $email)) { // gets domain name list($username,$domain)=split('@',$email); // checks for if MX records in the DNS if(!checkdnsrr($domain, 'MX')) { return false; } return true; } return false; } ?> I'm having a problem and need an answer to why its happening and how to prevent it. Scenario: I begin load my home page which starts with a session_start(); .... Before it FULLY completes loading I try to navigate to another page and BOOM, that page will not load and any other page that begins with session_start(); will not load unless I close and restart the entire browser or wait about 10 minutes.... I will note my website makes ajax calls every 5 seconds or so, but I use setTimeout for them. Any help??? Thanks ahead! Hi nothing seems to work! No error messages appear and no data enters my database! Can people please help me please! Needs to be solved by today! Thanks <?php //connect to db $connect = mysql_connect("l", "", ""); mysql_select_db("", $connect); //if submit button gets pressed if(isset($_POST['submit'])){ //Grab data from the form $username = preg_replace('#[^A-Za-z0-9]#i','', $_POST['username']); // filter everything but letters and numbers $firstname = preg_replace('#[^A-Za-z]#i', '', $_POST['firstname']); // filter everything but Letters $lastname = preg_replace('#[^A-Za-z]#i', '', $_POST['lastname']); // filter everything but Letters $phone = preg_replace('#[^0-9]#i', '', $_POST['phone']); // filter everything but numbers $address= preg_replace('#[^A-Za-z]#i', '', $_POST['address']); // filter everything but Letters $postcode= preg_replace('#[^A-Za-z]#i', '', $_POST['postcode']); // filter everything but Letters $town= preg_replace('#[^A-Za-z]#i', '', $_POST['town']); // filter everything but Letters $housenumber= preg_replace('#[^0-9]#i', '', $_POST['housenumber']); // filter everything but numbers $b_m = preg_replace('#[^0-9]#i', '', $_POST['birth_month']); // filter everything but numbers $b_d = preg_replace('#[^0-9]#i', '', $_POST['birth_day']); // filter everything but numbers $b_y = preg_replace('#[^0-9]#i', '', $_POST['birth_year']); // filter everything but numbers $email1 = mysql_real_escape_string (stripslahes (strip_tags($_POST['email1']))); $email2 = mysql_real_escape_string (stripslahes (strip_tags($_POST['email2']))); $pass1 = md5(mysql_real_escape_string (stripslahes (strip_tags($_POST['pass1'])))); $pass2 = stripslashes(strip_tags($_POST['pass2'])); $emailCHecker = mysql_real_escape_string($email1); $emailCHecker = str_replace("`", "", $emailCHecker); // Database duplicate username check setup for use below in the error handling if else conditionals $sql_uname_check = mysql_query("SELECT username FROM member WHERE username='$username'"); $uname_check = mysql_num_rows($sql_uname_check); // Database duplicate e-mail check setup for use below in the error handling if else conditionals $sql_email_check = mysql_query("SELECT email FROM member WHERE email='$emailCHecker'"); $email_check = mysql_num_rows($sql_email_check); // Convert Birthday to a DATE field type format(YYYY-MM-DD) out of the month, day, and year supplied $dateofbirth = "$b_y-$b_m-$b_d"; //If any errors have been found, DO NOT register the member, and instead, redisplay the form } if (!isset($username) || !isset($firstname) || !isset ($lastname) || !isset($address) || !isset($postcode) || !isset($town) || !isset($b_m) || !isset($b_d) || !isset($b_y) || !isset($email1) || !isset($email2) || !isset($pass1) || !isset($pass2)) { $errorMsg = 'ERROR: You did not submit the following required information:<br /><br />'; if(!isset($username)){ $errorMsg .= ' * User Name<br />'; } if(!isset($firstname)){ $errorMsg .= ' * First Name<br />'; } if(!isset($lastname)){ $errorMsg .= ' * Last Name<br />'; } if(!isset($address)){ $errorMsg .= ' * Address<br />'; } if(!isset($postcode)){ $errorMsg .= ' * postcode<br />'; } if(!isset($town)){ $errorMsg .= ' * town<br />'; } if(!isset($b_m)){ $errorMsg .= ' * Birth Month<br />'; } if(!isset($b_d)){ $errorMsg .= ' * Birth Day<br />'; } if(!isset($b_y)){ $errorMsg .= ' * Birth year<br />'; } if(!isset($email1)){ $errorMsg .= ' * Email Address<br />'; } if(!isset($email2)){ $errorMsg .= ' * Confirm Email Address<br />'; } if(!isset($pass1)){ $errorMsg .= ' * Login Password<br />'; } if(!isset($pass2)){ $errorMsg .= ' * Confirm Login Password<br />'; } if ($email1!= $email2){ $errorMsg.='ERROR: Your email fields below do not match<br />'; } if ($pass1!= $pass2){ $errorMsg.='ERROR: Your password fields below do not match<br />'; } if(strlen($username)<6){ $errorMsg.="<u>ERROR:</u><br/>Your User Name is too short. 6-20 characters please. <br/>"; } if(strlen($username)>20){ $errorMsg.="<u>ERROR:</u><br/>Your User Name is too long. 6-20 characters please. <br/>"; } if($username_check>0){ $errorMsg.="<u>ERROR:</u><br/> Your User Name is already in use inside of our system. Please try another.<br/>"; } if($email_check >0){ $errorMsg.="<u>ERROR:</u><br/>Your Email address is already in use inside of our system. Please use another.<br/>"; } } else{ mysql_query("INSERT INTO member (username, firstname, lastname, email, password, dateofbirth, phone, lastlogin) VALUES('$username','$firstname','$lastname','$email1','$password', '$dateofbirth','$phone', now())") or die (mysql_error()); $sql = mysql_query("INSERT INTO address (address, postcode, town, housenumber) VALUES('$adress','$postcode,'$town','$housenumber'") or die (mysql_error()); mysql_close(); Echo "Welcome to my site, $username! You may now <a href=\"index.php\">login</a>."; } ?> I'am trying to make the page show the errors in the same page under the register button, but it always disable all the forms and show the error by it self. my code: Quote <?php ob_start(); session_start(); include_once "functions.php"; connect(); if(!$_POST['submit']){ echo "<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n"; echo "<form method=\"post\" action=\"register.php\">\n"; echo "<tr><td colspan=\"2\" align=\"center\">Registration Form</td></tr>\n"; echo "<tr><td>Username</td><td><input type=\"text\" name=\"name\" maxLength=14></td></tr>\n"; echo "<tr><td>Password</td><td><input type=\"password\" name=\"password\" maxLength=14></td></tr>\n"; echo "<tr><td>Confirm</td><td><input type=\"password\" name=\"passconf\" maxLength=14></td></tr>\n"; echo "<tr><td>E-Mail</td><td><input type=\"text\" name=\"email\" maxLength=24></td></tr>\n"; echo "<tr><td>Question</td><td><input type=\"text\" name=\"idnumber\" maxLength=14></td></tr>\n"; echo "<tr><td>Answer</td><td><input type=\"text\" name=\"phone\" maxLength=14></td></tr>\n"; echo "<form method=\"post\" action=\"captcha.php\">\n"; echo "<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n"; echo "<tr><td>Type The Letters You See Below Into the Box</td></tr>\n"; echo "<tr><td align=\"center\"><img src=\"image.php\"></td></tr>\n"; echo "<tr><td align=\"center\"><input type=\"text\" name=\"image\"></td></tr>\n"; echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Register\"></td></tr>\n"; echo "</form></table>\n"; }else { $errors = array(); $name = protect($_POST['name']); $password = protect($_POST['password']); $confirm = protect($_POST['passconf']); $email = protect($_POST['email']); $phone = protect($_POST['idnumber']); $ownerReply = protect($_POST['phone']); $image = $_POST['image']; if($image == $_SESSION['string']){}else{ $errors[] = "Wrong Captcha!"; }ob_end_flush(); if(!$name){ $errors[] = "Username is not defined!"; } if(!$password){ $errors[] = "Password is not defined!"; } if($password){ if(!$confirm){ $errors[] = "Confirmation password is not defined!"; } } if(!$email){ $errors[] = "E-mail is not defined!"; } if(!$idnumber){ $errors[] = "Security Question is not defined!"; } if(!$phone){ $errors[] = "Security Answer is not defined!"; } if($name){ if(!ctype_alnum($name)){ $errors[] = "Username can only contain numbers and letters!"; } $range = range(8,14); if(!in_array(strlen($name),$range)){ $errors[] = "Username must be between 8 and 14 characters!"; } } if($password && $confirm){ if($password != $confirm){ $errors[] = "Passwords do not match!"; } $range = range(10,14); if(!in_array(strlen($password),$range)){ $errors[] = "Password must be between 10 and 14 characters!"; } } if($email){ $checkemail = "/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i"; if(!preg_match($checkemail, $email)){ $errors[] = "E-mail is not valid, must be name@server.tld!"; } } if($idnumber){ if(!ctype_alnum($phone)){ $errors[] = "Securty Question can only contain numbers and letters!"; } $range = range(8,14); if(!in_array(strlen($idnumber),$range)){ $errors[] = "Securty Question must be between 8 and 14 characters!"; } } if($phone){ if(!ctype_alnum($phone)){ $errors[] = "Securty Answer can only contain numbers and letters!"; } $range = range(8,14); if(!in_array(strlen($phone),$range)){ $errors[] = "Securty Answer must be between 8 and 14 characters!"; } } if($email){ $sql2 = "SELECT * FROM `account` WHERE `email`='".$email."'"; $res2 = mysql_query($sql2) or die(mysql_error()); if(mysql_num_rows($res2) > 0){ $errors[] = "The e-mail address you supplied is already in use of another user!"; } } if(count($errors) > 0){ foreach($errors AS $error){ echo $error . "<br>\n"; } }else { $sql4 = "INSERT INTO `account` (`name`,`password`,`email`,`idnumber`,`phone`) VALUES ('".$name."','".md5($password)."','".$email."','".$idnumber."','".$phone."')"; $res4 = mysql_query($sql4) or die(mysql_error()); echo "You have successfully registered with the username <b>".$name."</b> and the password of <b>".$password."</b>!"; } } ?> Direct link to the register page in case you didn't understand what i mean. http://hebrithco.com/server/bew/ Hello Coddy Guys,im trying to do simple website creator Maybe i don't have Disease Centres probably do not have the imagination to do or something else. I wan't to do. when member is registered and he got template that chosed in registration. how to create new folder with users template. Maybe you got it. Thanks. I installed phpbb to my site; however i didn't like it so i deleted it. Now my register.php (which hasn't been changed and worked before the phpbb install) will not post data to my database. If someone can help me fix this problem id be most thankful. Hi, I'm very new to php/mysql, but for a project I'm working on I need to create users that are admins, and normal users. The admins would be able to post news stories, and delete user accounts. Whereas the users would just be able to comment on the news stories. I'm just wondering how I would create a normal 'register' page for both, which has the same fields, but somehow creates some people as admins, and others as normal users... with the ability to limit who can become an admin, so not everyone can register as one. I'm not sure how I would achieve this, or even know how to do it. Does anyone know any tutorials or code on how to achieve this? Your help is greatly appreciated, Thanks. I have a page with results from a query that displays that has a link (works fine - passes variables etc) that deletes that line item from a database. It goes to the delete.php and actually executes and removes the item from the database and then has the line header("Location: page.php"); which returns BACK to the page displaying the results. However, it shows the old results until I hit Refresh in the browser. Its like the header is redirecting to a cached version of the page.
NOTE: This script used to work fine untouched when we where on a shared hosting account. We JUST updates to VPS hosting by the same host. Now this problem has risen and I can't figure out what is wrong. From what I can guess is there is something in php.ini that is either not set, set or set wrong. Any help would be greatly appreciated.
Thanks.
Hello frnds, Im new in ur forum....I want to know that my one page is taking too much time to load....in that page no images exists..but on that page around 6000 records are loding from database....I m confuse that may be such a large records it is taking too much time...so will u help me out that what can i do so the page can be loaded quickly with these records.... this is urgent for me.....pls pls pls....give me solution soon Thnx a lot in advance Hi, I've been wondering if it is possible to load a php page according to certain time. For example at 12:00 pm a php form will pop up automatically informing an employee to fill in something in the form, another form will pop up at 4:00 pm, etc... Thanks in advance When a person visits my site I would like for the form on the page to submit and reload with the predetermined search criteria. Is this possible? So for example...if you visited my site as soon as you entered the from would submit and display Google search results for "php freaks" I tried header("location: mysite.com?q=php+freaks"); but that is a continuous loop. -Any thoughts Hi! I am looking for a script that counts how many queries is executed on page load? I hadn't realised one of my scripts was doing hundreds of queries simultaneously and never would of thought this would be the cause of high load. As I'm developing stuff in PHP, I want to ensure minimum queries are executed especially because I am doing this in a procedural manner and not OOP. Thanks in advance. I have a page that processes a variable passed in the url to go get information out of a text file in JSON format. For some reason though, passing one variable loads a page, passing a certain variable (who's data in the file is virtually identical to the first) will cause the browser to just load the page indefinitely. Maybe even more strange is that on my local machine, the variable that won't load is switched, and the other loads fine. How can I debug what's happening when the page never loads so that I never get an error? Is there some way of a php include which is visible on every page (footer), itself having two php includes, but only one of which would be visible, then on the user refreshing the page or on visiting another page on the site, that include would be replaced with another php include? Preferably done without any js. Any help appreciated. Chris Hi, I have a div which reloads every 10 seconds but I want it so that if it equals something then redirect the whole page when at the moment it just loads the whole page in in the div but need the div as it stores all my variables, anyone know of anything else I can use? Thanks can someone please help me with this I'm trying to make it so that when the page loads just the condition below will happend unless the if statment happends. so I need two if statments that work off of one condition? so i was thinking of using OR but i would need a if statement that says the page is being loaded what this code does it displays someones profile when search is hit but i want it to display the persons own profile soon as the page is loaded first Code: [Select] <?php if(isset($_POST['search'])) { // searches goaulds then displays them $search3 = "SELECT goauld,id FROM users WHERE goauld='".mysql_real_escape_string($_POST['goaulds'])."'"; $search2 = mysql_query($search3) or die(mysql_error()); WHILE($search1 = mysql_fetch_array($search2)){ $grab_goauld = $search1['goauld']; echo '<table width="300" height="5" border="1" align="center">'; echo '<th><center>Goauld Statistics</center></th>'; echo "<tr><td height='340'>$grab_goauld</td></tr>"; } } echo '</table>'; ?> |