How can i fix this please Deprecated: Function session_register() is deprecated in /index.php on line 3 Code (markup): <?php session_start(); session_register("refid_session"); foreach($_GET as $k=>$v) $id .=$k; if($id !="") { if($_SESSION["refid_session"]=="") { $_SESSION["refid_session"]=$id ; } } include "header.php"; include "config.php"; $rs=mysql_query("select count(*) from users where active=1"); $arr=mysql_fetch_array($rs); $totalusers=$arr[0]; $rs=mysql_query("select * from pages where ID=1"); $arr=mysql_fetch_array($rs); $arr[2]=str_replace("{sitename}",$sitename,$arr[2]); $arr[2]=str_replace("{totalinvestment}",$totalinv,$arr[2]); $arr[2]=str_replace("{membersearnings}",$memearn,$arr[2]); $arr[2]=str_replace("{totalusers}",$totalusers,$arr[2]); echo stripslashes($arr[2]); include "footer.php"; ?> PHP:
Use $_SESSION directly to set variables instead of session_register()... If you want your script to work regardless of register_globals, you need to instead use the $_SESSION array as $_SESSION entries are automatically registered. If your script uses session_register(), it will not work in environments where the PHP directive register_globals is disabled. So instead your line with session_register("refid_session"); PHP: I'd use $_SESSION['session_name'] = 'refid_session'; PHP:
Sorry, i have one other problem ! Deprecated: Function eregi() is deprecated in /join.php on line 52 Code (markup): Lines 47 - 58 } elseif($_POST[password]!=$_POST[cpassword]) { $cpasswordError = 'Password and Confirm Password doesn\'t match.'; } if($_POST['email'] == '') { $emailError = 'You forgot to enter the email address.'; } else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", $_POST['email'])) { $emailError = 'Enter a valid email address to send to.'; } if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) { } else { $capError="Invalid Security Code."; } PHP:
Thank you for posting the link, although it does not really help much as im not a PHP coder ! i don't know how to add/replace "preg_match" into my code ?
Email validation is not as easy as it seems... It can be done with several good methods. In YOUR case, I would do it like this : } elseif($_POST[password]!=$_POST[cpassword]) { $cpasswordError = 'Password and Confirm Password doesn\'t match.'; } if($_POST['email'] == '') { $emailError = 'You forgot to enter the email address.'; } else { $email = $_POST['email']; // take a given email address and split it into the username and domain. list($userName, $mailDomain) = split("@", $email); if (checkdnsrr($mailDomain, "MX")) { // this is a valid email domain! } else { // this email domain doesn't exist! $emailError = 'Enter a valid email address to send to.'; } } if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) { } else { $capError="Invalid Security Code."; } PHP: If the checkdnsrr function returns TRUE, then you know you’ve got a valid email domain (but not necessarily a valid user name). If the function returns FALSE, then the email domain given is invalid. Hope this helps....
Thank you for your help, although now i get this Deprecated: Function split() is deprecated in /join.php on line 55 Code (markup): Lines 49 - 62 } if($_POST['email'] == '') { $emailError = 'You forgot to enter the email address.'; } else { $email = $_POST['email']; // take a given email address and split it into the username and domain. list($userName, $mailDomain) = split("@", $email); if (checkdnsrr($mailDomain, "MX")) { // this is a valid email domain! } else { // this email domain doesn't exist! $emailError = 'Enter a valid email address to send to.'; } PHP:
hmmmm..... try this, it's working on my server (PHP Version 5.2.17) : $regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*" ."@[a-z0-9-]+(\.[a-z0-9-]{1,})*" ."\.([a-z]{2,}){1}$"; if(!eregi($regex,$email)){ // email is NOT valid } else { // email IS valid } PHP:
Lol, don't listen to dujmovicv: both eregi and split are deprecated. Try this: http://php.net/manual/en/filter.examples.validation.php