[PHP] Re: header('Location:') works locally but not remotely
ok I have a page that calls my my functions, basically a 6 step signup. All the steps look like this function step_one() { $_SESSION['property_id'] =$_POST['property_id']; $property_id = $_POST['property_id']; $postcode= $_POST['postcode']; $query = INSERT INTO properties (property_id, postcode) VALUES ('$property_id', '$postcode'); $result= mysql_query($query); header( 'Location: ?step=two' ); } This SHOULD redirect to add_new.php?step=two As add_new is the container page. Thanks. R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: header('Location:') works locally but not remotely
-Message d'origine- De : Ross [mailto:[EMAIL PROTECTED] Envoyé : lundi 16 avril 2007 19:45 À : php-general@lists.php.net Objet : [PHP] Re: header('Location:') works locally but not remotely ok I have a page that calls my my functions, basically a 6 step signup. All the steps look like this function step_one() { $_SESSION['property_id'] =$_POST['property_id']; $property_id = $_POST['property_id']; $postcode= $_POST['postcode']; $query = INSERT INTO properties (property_id, postcode) VALUES ('$property_id', '$postcode'); $result= mysql_query($query); header( 'Location: ?step=two' ); } php.net http://fr.php.net/header: Note: HTTP/1.1 requires an absolute URI as argument to » Location: including the scheme, hostname and absolute path, but some clients accept relative URIs. You can usually use $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF'] and dirname() to make an absolute URI from a relative one yourself /php.net Could this be your issue? I always use full URI for header('location: Regards, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: header('Location:') works locally but not remotely
-Message d'origine- De : Tim [mailto:[EMAIL PROTECTED] Envoyé : lundi 16 avril 2007 19:54 À : 'Ross'; php-general@lists.php.net Objet : RE: [PHP] Re: header('Location:') works locally but not remotely -Message d'origine- De : Ross [mailto:[EMAIL PROTECTED] Envoyé : lundi 16 avril 2007 19:45 À : php-general@lists.php.net Objet : [PHP] Re: header('Location:') works locally but not remotely ok I have a page that calls my my functions, basically a 6 step signup. All the steps look like this function step_one() { $_SESSION['property_id'] =$_POST['property_id']; $property_id = $_POST['property_id']; $postcode= $_POST['postcode']; $query = INSERT INTO properties (property_id, postcode) VALUES ('$property_id', '$postcode'); $result= mysql_query($query); header( 'Location: ?step=two' ); } php.net http://fr.php.net/header: Note: HTTP/1.1 requires an absolute URI as argument to » Location: including the scheme, hostname and absolute path, but some clients accept relative URIs. You can usually use $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF'] and dirname() to make an absolute URI from a relative one yourself /php.net Could this be your issue? I always use full URI for header('location: Sorry i meant i always use full host/uri/extra schema Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: header('Location:') works locally but not remotely
On Apr 16, 2007, at 12:44 PM, Ross wrote: ok I have a page that calls my my functions, basically a 6 step signup. All the steps look like this function step_one() { $_SESSION['property_id'] =$_POST['property_id']; $property_id = $_POST['property_id']; $postcode= $_POST['postcode']; Escape your data: $property_id = mysql_real_escape_string($_POST['property_id']); $postcode = mysql_real_escape_string($_POST['postcode']); $query = INSERT INTO properties (property_id, postcode) VALUES ('$property_id', '$postcode'); $result= mysql_query($query); header( 'Location: ?step=two' ); As others have mentioned, you must include at least the relative path. header (Location: add_new.php?step=two); exit; Always include 'exit;' after a redirect. Happy coding... ~Philip } This SHOULD redirect to add_new.php?step=two As add_new is the container page. Thanks. R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: header(Location: page.php target=_parent)?????
use javascript body onLoad=javascript:parent.document.location.href='page.php'/body not the header function. Jacques [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] How should I formulate the header function to replace the current frameset page with a new one? I have tried a combination of header(Location: page.php target=_parent); but I get an error message saying the page does not exist. Also, can I save a frameset page with a .php extension? I have tried it out and it seems to work. Maybe perhaps I should not do this as there may be some implications later on??? Regards Jacques -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: header(Location: question
That will tell the browser The movie is there!Go there instead! umm.. Kinda like that anyway.. It lets the user download from there, and not your server.. -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com John [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] when you use a command like this: header(Location: http://www.highbandwidhtmirror.com/videos/download.mpg;); Is the user downloading off the mirror site or is your server downloading from the mirror and passing on to the end user. I want to save bandwidth by having mirror urls of funny videos, so will this work? -- ** Free Nokia Ringtones US http://www.ring-tones.us ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: header (Location: URL);
Ali [EMAIL PROTECTED] wrote in message 001701c1bada$f5ca5780$[EMAIL PROTECTED]">news:001701c1bada$f5ca5780$[EMAIL PROTECTED]... Hello, is there any possibility of redirecting a request URL using header:Location and openning the requested URL in a new window linke target=blank in html. Thank you. Ali -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: header(Location:...) much faster then http-equiv=refresh? too fast?
When I use header(Location: ...) to redirect the user back to the record Send a Header(pragma no-cache) before Header(Location) and it will work. Roko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: header(Location:...) much faster then http-equiv=refresh? too fast?
How and when mysql performs a delete depends on several things including, the type of table that is used, configuration parameters and the wording of the delete query. There are some situations in which deletes are put into a que and performed only after there are no connections to the table. Since I am not familiar with your set up or code, you will need to read the mysql docs to determine if this is in fact the situation you find yourself in. Fred Avi Schwartz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I have a strange problem. I have a page that displays a list of records. When the user clicks on the delete link by one of the records, a php script is taking care to delete that specific record and then redirects back to the record list. I use PEAR::DB with MySQL. When I use header(Location: ...) to redirect the user back to the record list page, many times the screen still displays the old list and I have to refresh the page so see that the record was deleted. At first I thought that the page is redisplayed from the cache so I added the appropriate meta tags to make sure that the page will not be cached by the browser. Since sometimes it worked and sometimes it didn't, I started suspecting the the problem may be with the fact that the database (mysql) may have not removed the record yet by the time the record list is redisplayed. I decided to try to use the http-equiv=refresh meta tag with a delay of 1 second, and suddenly the problem has disappeared. I also worked by setting the delay to 0. Does the above suspicion I have even make sense? Why would mysql not complete the delete when the delete is executed? Avi -- Avi Schwartz [EMAIL PROTECTED] I have to share the credit. I invented it, but Bill made it famous. - IBM engineer Dave Bradley describing the control-alt-delete reboot sequence -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: header(Location:);
[EMAIL PROTECTED] (Alberto) wrote: Ok, it works fine for me, i can redirection, but I don't want the browser to load another page, I want to IF A THEN RUN A.PHP, IF B THEN RUN B.PHP, I know i can use include('a.php') or require('a.php') but I'm sure theres a way to say php parser to run one or another script without changing URL to the client. use include as you say or html frames. -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: header(Location:);
On Tuesday, October 30, 2001, at 11:41 AM, Henrik Hansen wrote: [EMAIL PROTECTED] (Alberto) wrote: Ok, it works fine for me, i can redirection, but I don't want the browser to load another page, I want to IF A THEN RUN A.PHP, IF B THEN RUN B.PHP, I know i can use include('a.php') or require('a.php') but I'm sure theres a way to say php parser to run one or another script without changing URL to the client. use include as you say or html frames. Yeah, why not if($A) { include('a.php'); } elseif ($B) { include('b.php'); } -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: header(Location:...) is redirect: looking for full link
Add *ANOTHER* variable in the header(Location:) code that says redirect=1 In your page3, do: if($redirect){ $menuID = $foo; } else{ $menuID = $bar; } Where foo comes from the location, but bar comes from page2. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Chrisy [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Saturday, September 08, 2001 5:03 PM Subject: header(Location:...) is redirect: looking for full link hi, The long explanation is below the summary. SUMMARY page1.php Header(location:page2.php) page2.php HTML link to page3.php page3.php REFERER=page1.php But in page3 i WANT to see page2.php as REFERER. So i suppose i must change something in page1. But what? XXX THE LONG: i am working on a dynamic menu module for postnuke. When a page is called with page.php?menuID=23000 that means the second main menu is opened, and of that branch the 3rd subbranch: MENU1 V MENU2 * MENU21 * MENU22 V MENU23 * MENU231 * MENU232 MENU3 MENU4 In effect this means i make the part of the page which makes the menu. I can't use a form and i can't use session. Now my poroblem is when people follow a link in the menu which in itself has subpages, the folllowing links can not be expected to always contain the menuID part. In effect the menu would unfortunately close. Now i did this trick: i would read menuID in the referer and Then i would do header ('location:'.thispageURL. 'menuID'. $menuID); So: 1)REFERER?menuID=123 --links-to-- 2) page.php?nada=0 --checks-(finds no menuID so looks it up in referer)then-redirects- 3) page.php?nada=0menuID=123 Works nice up till then. But. Okay, now that page is allright but as header (location) is a REDIRECT, the following page does not see the added menuID as it uses the URI of step 2). help.. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]