Topic awaiting preservation: PHP Strip (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: Johannesburg, Gauteng, South Africa |
posted 11-01-2005 14:04
Hi there |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 11-01-2005 14:41
Sure... you'll need either php->substr and php->strpos or php->preg_match to extract the domain name, |
Paranoid (IV) Inmate From: France |
posted 11-01-2005 14:51 |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 11-01-2005 18:11
well... except that he asked for php and you answered in javascript, nicely done poi! |
Paranoid (IV) Inmate From: INFRONT OF MY PC |
posted 11-01-2005 18:29
TP noticed the link in resultnt ?? it goes to page 1 of the asylum |
Paranoid (IV) Inmate From: France |
posted 11-01-2005 18:36
I was too lazy to save the file in a folder mapped in my httpconf pressing F12 in UltraEdit was mucho faster for a quick and dirty test. code: function process( formHandle ) { var result = formHandle.elements['email'].value.match( /@(.*$)/ ) if( result ) document.body.innerHTML += "<img src='http://www."+ result[1] +"/favicon.ico' /> " } Which suddenly made me wonder why email clients don't use some kind of favatars. |
Bipolar (III) Inmate From: Johannesburg, Gauteng, South Africa |
posted 11-02-2005 11:34
Thanks for the replies - much appreciated code: <form post=domain.php> <input type=text name=email size=20 class=small> <input type=submit value=go name=go> </form>
code: <?php # Accept HTTP POST variables extract ($_POST); ?> <?php function process( formHandle ) { var result = formHandle.elements['email'].value.match( /@(.*$)/ ) if( result ) document.body.innerHTML += "<img src='http://www."+ result[1] +"/favicon.ico' /> " } ?>
|
Paranoid (IV) Inmate From: France |
posted 11-02-2005 11:58
Sorry, but as TP and I said, the code snippets I've posted are in JavaScript. NOT in PHP. You'll have to play/fiddle/learn with it and the links TP gave you to turn them into PHP. code: header( "Location: ". $newUrl ); exit(); |
Bipolar (III) Inmate From: Johannesburg, Gauteng, South Africa |
posted 11-02-2005 12:36
Oh - oops - sorry about that |
Bipolar (III) Inmate From: Johannesburg, Gauteng, South Africa |
posted 11-02-2005 12:36
ok to be honest... i create graphics - and know next to nothing about code |
Paranoid (IV) Inmate From: France |
posted 11-02-2005 12:56 |
Maniac (V) Inmate From: under the bed |
posted 11-02-2005 14:43
Plenty of good info here for what you need. Personally, I would go with TP's initial suggestions using substr and strpos in PHP - mainly because I'm not comfortable working in javascript. |
Bipolar (III) Inmate From: Johannesburg, Gauteng, South Africa |
posted 11-10-2005 11:54
Okie dokie code: <?php # Accept HTTP POST variables extract ($_POST); ?> <?php # Get input e-mail address $email = "$email"; # Seperate e-mail address into user- and host names list ($user,$host) = explode ("@",$email); # Display output echo ("User: ".$user); echo ("<br>"); echo ("Host: ".$host); ?>
|
Bipolar (III) Inmate From: Johannesburg, Gauteng, South Africa |
posted 11-10-2005 12:02
Okay - I redirected it to the domain took me a while to figure out but its working code: <?php # Accept HTTP POST variables extract ($_POST); ?> <?php # Get input e-mail address $email = "$email"; # Seperate e-mail address into user- and host names list ($user,$host) = explode ("@",$email); # Display output echo ("User: ".$user); echo ("<br>"); echo ("Host: ".$host); # Redirect browser to host header("Location: http://webmail.$host"); exit; ?>
|
Bipolar (III) Inmate From: Johannesburg, Gauteng, South Africa |
posted 11-10-2005 14:55
Hi again... well it works on my machine but doesn't seem to work on the server. code: <?php # Accept HTTP POST variables extract ($_POST); ?> <?php # Get input e-mail address $email = "$email"; # Seperate e-mail address into user- and host names list ($user,$host) = explode ("@",$email); # Redirect browser to host header("Location: http://webmail.$host"); exit; # Display output echo ("User: ".$user); echo ("<br>"); echo ("Host: ".$host); ?>
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 11-10-2005 15:28
You can't output any text to the browser before sending headers, that includes the space between the first closing php tag and the second opening tag. |
Maniac (V) Inmate From: Sthlm, Sweden |
posted 11-10-2005 16:01
Hi, this is probably the problem here: code: <?php // Get input e-mail address $email = $_POST['email']; //validate email here, thiws just checks that it's not empty if($email != '') { // Seperate e-mail address into user- and host names list ($user,$host) = explode ("@",$email); // Redirect browser to host header("Location: http://webmail.$host"); exit; } else { print('No email adress provided'); } ?>
|
Bipolar (III) Inmate From: Johannesburg, Gauteng, South Africa |
posted 11-21-2005 14:58
Hi there - me again code: <?php # Accept HTTP POST variables extract ($_POST); //validate email here, this just checks that it's not empty $email = "$email"; if (eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $email)) { echo "'$email' is a valid email!"; // Separate e-mail address into user- and host names list ($user,$host) = explode ("@",$email); // Redirect browser to host header("Location: http://webmail.$host"); exit; } else { print('No email address provided'); } ?>
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 11-21-2005 18:33
It's not really clear here but a couple of things |
Bipolar (III) Inmate From: Johannesburg, Gauteng, South Africa |
posted 11-24-2005 08:29
i am such an a-hole!! |