Jump to content

mrb1972

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by mrb1972

  1. Hi, Does anyone know how a "save to shortlist" scripts work, you find these sort of things on propery sites, where the site user can "add/tag" different properties to a shortlist. where they can view next time they visit the site, im guessing its done with cookies. Im looking to add something similar but can quite work out how this is done, if anyone has any ideas or pointers that would be great. thanks
  2. I havent tried your suggestion yet, but i did get it working by changing header("HTTP/1.1 301 Moved Permanently"); to header('Status: 301 Moved Permanently'); I dont know if this is the correct fix, but it seems to work
  3. Hi, I wonder if anyone can point me in the right direction, I recently moved my site to a new server running php 5, which has caused a problem with 301 redirect. Instead of automatically redirecting like it use to i now get a message: "OK The document has moved here." here being the link to the new url.. this didnt happen on the old server it just redirected automatically, Im told its PHP5 thing!!, my site uses this function function redirectIfWrongURL($correcturl) { global $vchSiteUrl; /* does a 301 redirect to the correct URL if the actual URL is different */ $actualurl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; if (isset($_SERVER["HTTP_X_FORWARDED_HOST"])) { $actualurl ='http://'. $_SERVER["HTTP_X_FORWARDED_HOST"] . $_SERVER['REQUEST_URI']; } if ($correcturl != $actualurl) { header("HTTP/1.1 301 Moved Permanently"); header("Location: " . $correcturl); echo '<br>This page has moved to <a href="' . $correcturl . '">' . $correcturl . '</a><br />Old URL: ' . $actualurl."<br />\n";; //print_r($_POST); exit(); } } Anyone have any idea? thanks
  4. Yes thanks i have tried that, no joy.. I even got the hosting company to turn register back on, but still the form will only work with php_self part removed.. ??? I give up..
  5. ok, i think im getting somewhere, it looks the like the form is working now, but i had to remove action="<?$PHP_SELF?>" from the form code!. Any one know why this would cause the problem..? thanks
  6. Hi, I cant get access to the php.ini, but i did add those lines to the code as your stated, but all i get it a blank page still?
  7. ahh ok , changed that but still no joy
  8. Thanks for that, unfortunatley I now only get a blank page, it dosent seem to like the if(isset($_POST['submit_x')) part
  9. No its not a lot of code here is the php part, the bit i havent posted is just the html form which is below the php.. the problem is it just seems to ignore everything in (If statment) ..thanks <? include("includes/config.php"); $message = ""; if($REQUEST_METHOD=="POST" && isset($submit_x)) { if(empty($vchUserName)) $message .= "Please enter your username.<br>"; if(empty($vchPassword)) $message .= "Please enter your password.<br>"; if(empty($vchRePassword)) $message .= "Please confirm your password.<br>"; if(!empty($vchPassword) && !empty($vchRePassword)) { if(trim($vchPassword) != trim($vchRePassword)) { $message .= "Passwords don't match.<br>"; } } if(empty($vchEmail)) $message .= "Please enter your e-mail address."; if(empty($message)) { //check for the existence of the username and the password $exist = GiveValue("count(intMemberID) as cnt","tblMembers"," where vchUserName = '".$vchUserName."'",0); $exist1 = GiveValue("count(intMemberID) as cnt","tblMembers"," where vchEmail = '".$vchEmail."'",0); //print $exist; if($exist>0 || $exist1>0) { $message = "Duplicate username or e-mail address. Please try again"; } else { //insert $sql = "insert into tblMembers(vchUserName,vchPassword,vchEmail,chStatus,dtAdded) values('$vchUserName','$vchPassword','$vchEmail','D',now())"; //print $sql; mysql_query($sql); $MID = mysql_insert_id(); if(mysql_insert_id()) { //send email $myname = "New Zealand Stays"; $myemail = "listings@newzealandstays.co.nz"; $contactname = $vchUserName; $contactemail = $vchEmail; $strmessage = "Dear $contactname,<br/><br/>Thank you for registering on Newzealandstays, please confirm your registration by clicking on the following link to activate your membership account - <br><br><a href='http://$HTTP_HOST/confirm.php?user=$MID'>http://$HTTP_HOST/confirm.php?user=$MID</a><br><br>After confirmation you can use the members area to log-in and add your property on the website.<br><br>Regards,<br>Newzealandstays Administrator<br><br><a href='http://$HTTP_HOST'>$HTTP_HOST</a>"; $subject = "Confirmation email from - ".$HTTP_HOST; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\n"; $headers .= "From: ".$myname." <$myemail>\n"; $headers .= 'Cc: listings@newzealandstays.co.nz' . "\n"; mail($contactemail, $subject, $strmessage, $headers); $message = "A confirmation email has been sent to the email address you provided, please check your email and confirm your registration. Thank you"; //print $strmessage; } } } } fnHeader(); ?>
  10. if i use if(isset($_POST['submit_x')) then the page dosent even load up..
  11. Thanks for your comments so far, I have indeed tried the $SEVER['REQUEST_METHOD']; but it didnt seem to work, everything after the IF statment is ignored when the submit button is pressed <? include("includes/config.php"); $message = ""; if($REQUEST_METHOD=="POST" && isset($submit_x)) { And the form code is , does the $PHP_SELF self part need changing? <form name="frm" method="post" action="<?=$PHP_SELF?>"> thanks
  12. Hi, Im a bit of a PHP novice so any advice would be great, I have a website written quite a while ok which is being migrated to a new server which contains a new install of php. This has bought to light a few problems with the php code which my host has pointed out to me, one such example is the code; which dosent get executed any more if($REQUEST_METHOD=="POST" && isset($submit_x)) { Im told this is no longer valid on PHP 5.1.6 , my questions is, is this easy to fix, is it a big rewite, or just a few code changes. thanks
×
×
  • 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.