header problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

header problem

Post by itsmani1 »

when i click submit it takes me to: addproduct.php
and shows:

The page cannot be displayed

Please help me in this regard
I don't think there is some problem but its not working.

thanks

Code: Select all

<?PHP
session_start();
if(isset($_SESSION["login"]) and ($_SESSION["login"] == TRUE))
{
	include "../connection.php";
	if(isset($_POST["Submit"]))
	{
		header("Location:http://www.google.com");
		exit;
//		header("Location:addproduct.php?log=Image uploading filed");
		exit;

	}
}
?>
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Post by kendall »

are you sure you have the correct url...


maybe [s]u[/s] you need to be a bit more explanatory in order to get a more accurate response for a solution
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

kendall wrote:are you sure you have the correct url...


maybe u need to be a bit more explanatory in order to get a more accurate response for a solution

Yes, It works fine on FF but on IE it takes me to "addproduct.php" and show "The page cannot be displayed" but when i refresh again it takes me to correct page again
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Post by kendall »

let me see the url....ill try it in my FF and IE...if its showing up in one and not the other it could be a browser specific issue...however you said you had to refresh for it to display...there is probably a session not being set issue...
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Try

Code: Select all

header("Location: http://www.outsourcingi.com/ecom/admin/ ... ?log=Image%uploading%filed");
It is always recommended you avoid relative paths using header()
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Post by kendall »

well i tried the form

and it went [s]str8[/s] straight to the google home page...as is expected judging from the code...you would probably want to uncomment the line for me there dude.... :wink:
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Post by kendall »

well my work here is done :P :D
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

Please open this page in IE and FF
and press submit
you will see result.

thanks for reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

Here is the code, for FF it works file but not for IE, I don't know where is problem

Code: Select all

include "../connection.php";
	if(isset($_POST["Submit"]))
	{
		header("Location:http://www.google.com");
		exit;
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

this is creating problems:

If html form following is creating problem:


"enctype="multipart/form-data""

If i remove it works fine but i need to upload image as well.


thanks
Post Reply