473,320 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How can I get this redirect to work? (and this mail function)

How do i get this to work?
<?php
header('Location: http://www.PAGE-TO-REDIRECT-TO.com/');
mail('m*******@website.com', 'TEST', $_SERVER['REMOTE_ADDR']);
?>

Nov 5 '07 #1
5 1669
On Mon, 05 Nov 2007 23:37:46 +0100, <fo*******@gmail.comwrote:
<?php
header('Location: http://www.PAGE-TO-REDIRECT-TO.com/');
mail('m*******@website.com', 'TEST', $_SERVER['REMOTE_ADDR']);
?>
<?php
mail('m*******@website.com', 'TEST', $_SERVER['REMOTE_ADDR']);
header('Location: http://www.PAGE-TO-REDIRECT-TO.com/');
?>
--
Rik Wasmus
Nov 5 '07 #2
On Nov 5, 5:56 pm, "Rik Wasmus" <lu************@hotmail.comwrote:
On Mon, 05 Nov 2007 23:37:46 +0100, <fo*******@gmail.comwrote:
<?php
header('Location:http://www.PAGE-TO-REDIRECT-TO.com/');
mail('m*******@website.com', 'TEST', $_SERVER['REMOTE_ADDR']);
?>

<?php
mail('m*******@website.com', 'TEST', $_SERVER['REMOTE_ADDR']);
header('Location:http://www.PAGE-TO-REDIRECT-TO.com/');
?>
--
Rik Wasmus

So that would redirect the browser and then send the IP address of the
person accessing the page to an email?

Nov 5 '07 #3
On Nov 5, 3:03 pm, foulu0...@gmail.com wrote:
On Nov 5, 5:56 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
On Mon, 05 Nov 2007 23:37:46 +0100, <foulu0...@gmail.comwrote:
<?php
header('Location:http://www.PAGE-TO-REDIRECT-TO.com/');
mail('my-em...@website.com', 'TEST', $_SERVER['REMOTE_ADDR']);
?>
<?php
mail('my-em...@website.com', 'TEST', $_SERVER['REMOTE_ADDR']);
header('Location:http://www.PAGE-TO-REDIRECT-TO.com/');
?>
--
Rik Wasmus

So that would redirect the browser and then send the IP address of the
person accessing the page to an email?
that sends an email then redirects the browser.
notice the difference?

Nov 5 '07 #4
On Nov 5, 6:39 pm, dave <dave.wa...@gmail.comwrote:
On Nov 5, 3:03 pm, foulu0...@gmail.com wrote:
On Nov 5, 5:56 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
On Mon, 05 Nov 2007 23:37:46 +0100, <foulu0...@gmail.comwrote:
<?php
header('Location:http://www.PAGE-TO-REDIRECT-TO.com/');
mail('my-em...@website.com', 'TEST', $_SERVER['REMOTE_ADDR']);
?>
<?php
mail('my-em...@website.com', 'TEST', $_SERVER['REMOTE_ADDR']);
header('Location:http://www.PAGE-TO-REDIRECT-TO.com/');
?>
--
Rik Wasmus
So that would redirect the browser and then send the IP address of the
person accessing the page to an email?

that sends an email then redirects the browser.
notice the difference?
yes, thank you very much

Nov 6 '07 #5
..oO(Rik Wasmus)
>On a header redirect, the user effectively 'aborts' as soon as he got it.
A header() call doesn't sent the header out immediately. This would make
the second parameter pretty useless and would also let headers_sent()
return TRUE after the first header() call, which is not the case.

Even on a redirection header the script continues to run until it
reaches the end or an exit() call, so IMHO the OP's script should work
as expected.

Micha
Nov 6 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Hywel | last post by:
I'm having trouble with a bit of form to mail for a site I work on an was wondering if anyone could point out where I've gone wrong. <% Dim t1name,t1,t2name,t2,t3name,t3,t4name,t4,t5name,t5 ...
7
by: Lee David | last post by:
I want to redirect anyone going to one site to another site. I have a "windows.open" on the original site and that opens a new browser, but what I want it the old one to be replaced (or at least...
5
by: john | last post by:
Hello, One our thrid page for some reason the response.redirect isn't working on the live server. It works fine on the development machine but when we move the code to the live server it doesn't...
3
by: ASP Yaboh | last post by:
Does Response.Redirect() make a roundtrip to the client to complete the redirect? Is there a method which keeps the redirection server-side (e.g. in JPS .Forward() moves the action to a new...
3
by: david | last post by:
myIn the current web form page, I use Response.Redirect(fullURL) where fullURL = "ftp://myURL" to a FTP service (control by a button). But it does not work. What is wrong with it? Should it...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
5
by: accessman2 | last post by:
Hi, I have a question. I made the create the new user form. <script language="javascript"> function submitFrm() {
15
by: John | last post by:
Hello, I have a php contact script and I want it to redirect to my homepage without using the standard header command. <?php header("location:http://www.johndoe.com/index.html"); exit;
10
by: vinpkl | last post by:
hi all i want to show an alert box and then redirect page to another location through php code but its not working as needed. As i cannot use PHP HEADER LOCATION because i m using echo before...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.