Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo

In Need Of A Quick Drink And A Php Answer


  • Please log in to reply
7 replies to this topic

#1 tomsk

tomsk

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 323 posts
  • Location:UK

Posted 10 November 2009 - 10:24 AM

I have a small problem with a php email script and have no knowledge of php.

QUOTE
if(mail($your_email,$email_subject,$email_content)) {
echo 'Message sent!';


It works but just gives when an email is submitted the following text - 'message sent' - however I would like it to bit more imaginative ie: message sent redirecting you back to our home page - short delay then home page shows.

Any idea on the php require to achieve this?

Thanks in advance.



#2 tomsk

tomsk

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 323 posts
  • Location:UK

Posted 10 November 2009 - 11:04 AM

So a quick look around youtube and google suggests the following.
QUOTE
if(mail($your_email,$email_subject,$email_content)) {
echo "<meta http=equiv='refresh' content='0;url=http://url of page I would like to redirect to>";


However just shows me a blank page.


#3 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 10 November 2009 - 12:54 PM

You're most of the way there already. Just need to combine a couple of things.

In the meantime, have a drink or three! ale.gif stiffdrink.gif redwine.gif Beer_Dive.gif

Try this on for size and see if it accomplishes what you want.

CODE
if(mail($your_email,$email_subject,$email_content)) {
echo 'Message sent!<br />You will be redirected to our home page in five seconds';
echo "<meta http=equiv='refresh' content='5;url=http://url of page I would like to redirect to>";


#4 tomsk

tomsk

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 323 posts
  • Location:UK

Posted 10 November 2009 - 01:43 PM

Randy - message appears fine about redirect to home page but then just stays there.

So I am clear that I an doing it correctly it would look like this to redirect here?

if(mail($your_email,$email_subject,$email_content)) {
echo 'Message sent!<br />You will be redirected to our home page in five seconds';
echo "<meta http=equiv='refresh' content='5;url=http://www.highrankings.com>";

#5 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 10 November 2009 - 02:47 PM

Right.

Make sure it has a closing curly bracket at the end too, otherwise PHP is going to error out. And there was a missing single quote in there that may or may not have an effect.

Revamped the whole block would look like:

CODE
if(mail($your_email,$email_subject,$email_content)) {
echo "<meta http=equiv='refresh' content='5;url=http://www.highrankings.com'>";
echo "Message sent!<br />You will be redirected to our home page in five seconds";
}



#6 tomsk

tomsk

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 323 posts
  • Location:UK

Posted 10 November 2009 - 05:38 PM

Nope still not doing it for me - looks like a lock in in the pub area.

Still just shows the redirect information and does not then go to proposed url.

#7 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 11 November 2009 - 09:51 AM

Just a quick note for those reading along.

There is an additional small syntax error in there I didn't notice before. It's in the js redirect part where it says meta http=equiv. This of course should be meta http-equiv with a dash and not an equal sign.

So for future readers who might find this, the corrected code would be

CODE
if(mail($your_email,$email_subject,$email_content)) {
echo "<meta http-equiv='refresh' content='5;url=http://www.highrankings.com'>";
echo "Message sent!<br />You will be redirected to our home page in five seconds";
}


#8 tomsk

tomsk

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 323 posts
  • Location:UK

Posted 11 November 2009 - 10:00 AM

Thanks Randy!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

SPAM FREE FORUM!
 
If you are just registering to spam,
don't bother. You will be wasting your
time as your spam will never see the
light of day!