Jump to content

[SOLVED] A Little Help Please


CoolAffiilate

Recommended Posts

Hey Php Freaks!

 

I need some help here. Im really new at php... so if anyone can point me in the right direction that would be great!

 

Here is what I am looking for:

 

A person signs up at my newsletter.  Cool@cool.com.

 

The newsletter script ads them to  the database, then sends them to the subscribed page with the variable added to the query string:

 

mynewsletter.com/subscribed.html?address=coolguys%email

 

but what i need is to send them to a page that needs the variable

 

mynewsletter.com/welcome.php?email=

 

It will use the variable.

 

So, i need a script that will read a query string, and convert it into a new URL...

 

Anyone understand?

 

Thanks!

Link to comment
Share on other sites

I'm not too sure exactly what you are after, but if you want to read the parameters in the query string, on the page you can just do:

 

$email_address = $_GET['email'];

 

So on your welcome.php page, that bit of code will give you the value of the email address that is in the query string.

Link to comment
Share on other sites

Thank you...

 

But the problem is slightly different. What i need to do is capture the query string, and pass it on to a partner via URL. mine is:

 

cool.com/welcome.php?address=emailaddy

 

but they need

 

notcool.com/welcome.php?email=emailaddy

 

It needs to work similiar to a redirect.

Link to comment
Share on other sites

On your welcome.php page: (needs to go before any output)

 

$email_address = $_GET['address']; // email address passed in query string
header("Location: http://www.notcool.com/welcome.php?email=".$email_address); // the redirect

 

Are you doing anything else on the welcome.php page, or just the redirect, because if its just the redirect, it seems a bit redundant.  You might as well handle the redirect beforehand where you add the email address to the database etc.

Link to comment
Share on other sites

That's right.  Could also add an exit() statement just in case something goes wrong.

 

<?php
$email_address = $_GET['address']; // email address passed in query string
header("Location: http://www.notcool.com/welcome.php?email=".$email_address); // the redirect
exit();
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.