Forum Moderators: coopster

Message Too Old, No Replies

Match query string to an email on MySQL

Match and return data to Flash (AS2)

         

JuliaR

4:02 am on Oct 5, 2009 (gmt 0)

10+ Year Member



I'm having a list of email addresses and I only want the PHP to select one of them at a time, depending on the information passed through the strings and into the form. When PHP receives the query string I would like PHP to extract it and match to an email address ("www.myweb.com/main.html?blaBLA" --> extract as "?blaBLA").

I'm using Flash (AS2) to do my form and I send data using LoadVars to PHP. Here's the pseudocode for what I'm trying to do. (I'm not sure if the syntext is correct). PLease help me write this complete code.

where $list = "abc" then $email = "asdf@domain1.com"
where $list = "xyz" then $email = "qwer@domain2.net"
where $list = "def" then $email = "xcvb@domain3.org"
(repeated 30 times for 30 email addresses!)

I hope that make sense! I'd preffer to have the code because I'm NOT a PHP gal at all!

dreamcatcher

8:41 am on Oct 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi JuliaR, welcome to WebmasterWorld. :)

I think a switch [us2.php.net] statement will be ideal for what you are trying to accomplish.

switch ($list) {
case 'abc':
$email = "asdf@domain1.com";
break;
case 'xyz':
$email = "qwer@domain2.net";
break;
case 'def':
$email = "xcvb@domain3.org";
break;
}

Hope that helps.

dc