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.  [email protected].

 

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
https://forums.phpfreaks.com/topic/67239-solved-a-little-help-please/
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.

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.

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.

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();
?>

Archived

This topic is now archived and is closed to further replies.

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