473,800 Members | 2,613 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Nov 5 '07 #1
5 1686
On Mon, 05 Nov 2007 23:37:46 +0100, <fo*******@gmai l.comwrote:
<?php
header('Locatio n: 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('Locatio n: http://www.PAGE-TO-REDIRECT-TO.com/');
?>
--
Rik Wasmus
Nov 5 '07 #2
On Nov 5, 5:56 pm, "Rik Wasmus" <lu************ @hotmail.comwro te:
On Mon, 05 Nov 2007 23:37:46 +0100, <fo*******@gmai l.comwrote:
<?php
header('Locatio n: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('Locatio n: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.comwro te:
On Mon, 05 Nov 2007 23:37:46 +0100, <foulu0...@gmai l.comwrote:
<?php
header('Locatio n:http://www.PAGE-TO-REDIRECT-TO.com/');
mail('my-em...@website.c om', 'TEST', $_SERVER['REMOTE_ADDR']);
?>
<?php
mail('my-em...@website.c om', 'TEST', $_SERVER['REMOTE_ADDR']);
header('Locatio n: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...@gma il.comwrote:
On Nov 5, 3:03 pm, foulu0...@gmail .com wrote:
On Nov 5, 5:56 pm, "Rik Wasmus" <luiheidsgoe... @hotmail.comwro te:
On Mon, 05 Nov 2007 23:37:46 +0100, <foulu0...@gmai l.comwrote:
<?php
header('Locatio n:http://www.PAGE-TO-REDIRECT-TO.com/');
mail('my-em...@website.c om', 'TEST', $_SERVER['REMOTE_ADDR']);
?>
<?php
mail('my-em...@website.c om', 'TEST', $_SERVER['REMOTE_ADDR']);
header('Locatio n: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
1178
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 t1name = "Name" t1 = Request.Form("t1") t2name = "Company" t2 = Request.Form("t2")
7
2876
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 go way once they are redirected). How do I do this? TIA, Lee
5
2159
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 work. The first page is a login page and the response.redirect does work there but not on the third page. Any ideas? Thanks in advance. John
3
1289
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 JSP/servlet without a roundtrip to the client)? Thank you
3
1238
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 work? Thanks David
6
4904
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 the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
5
4538
by: accessman2 | last post by:
Hi, I have a question. I made the create the new user form. <script language="javascript"> function submitFrm() {
15
3145
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
39938
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 header. so i have to use javascript but through PHP. if(mail($to,$subject,$body,$headers)) {
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10507
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10255
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7582
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6815
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4150
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2948
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.