Forum Moderators: coopster

Message Too Old, No Replies

File upload and internal links BUG

         

smagdy

7:00 pm on Dec 27, 2006 (gmt 0)

10+ Year Member



I posted twice about this problem with no successfull solution, but now i just knew why it happens but i still dono what is the solution..

The thing is:

header("Location: h**p://www.mysite.se/somefile#a");
goes to
header("Location: h**p://www.mysite.se/somefile");

So it ignores everything from the hash till end (Just in IE6 & 7)

and this is happens only when the landing page has a form with enctype="multipart/form-data"

if i remove this [enctype="multipart/form-data"] then it works fine.. so how to solve this?

Thanks in advance

mcavic

9:01 pm on Dec 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just tried the PHP redirect without any forms, and it worked. I don't know why a form would make a difference. Does it work if you manually visit the url with the hash in it?

smagdy

11:44 pm on Dec 27, 2006 (gmt 0)

10+ Year Member



yes sure it works if i write it manualy..

The problem is not in the form, the problem is when i add this to the form [enctype="multipart/form-data"]... and i have to add it because i am uploading an image!

mcibor

7:23 am on Dec 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't know what the problem may be, but you can try adding quotes-it can help to force the IE to read the whole url

header("Location: 'h**p://www.mysite.se/somefile#a'");

Does it work on other browsers?

smagdy

9:13 am on Dec 28, 2006 (gmt 0)

10+ Year Member



Yes it works on firefox...

Have u tried it? and worked for you?

smagdy

9:51 am on Dec 31, 2006 (gmt 0)

10+ Year Member



Anybody?

alfaguru

5:04 pm on Dec 31, 2006 (gmt 0)

10+ Year Member



Have you validated the landing page? If it's not correct HTML that might cause the problem.

smagdy

8:13 pm on Jan 1, 2007 (gmt 0)

10+ Year Member



Hello, i validated it but still same problem but i got 1 more clue

Its that the file works as it should if i remove this line:

<input name="userfile" type="file">

So any clues?

smagdy

8:24 pm on Jan 1, 2007 (gmt 0)

10+ Year Member



Please somebody try these 2 simple files to see the problem:

File 1: a.php
-------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="cs/design.css">
<title></title>
</head>
<body>
<form name="newad" action="b.php" method="post" enctype="multipart/form-data">
<table id="table1" border="0">
<tr>
<td style="vertical-align:text-top"><A NAME="k"></A>Image:&nbsp;&nbsp;</td>
<td ><input name="userfile" type="file"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="preview" value="Preview my ad &rsaquo;&rsaquo;"></td>
</tr>
</table>
</form>
</body>
</html>

---------------------------------------

File 2: b.php
-------------
<?
header("Location: a.php#a");
?>
---------------------------------------

It will redirect correctly if u removed either:
enctype="multipart/form-data"
OR
<input name="userfile" type="file">

Thanks in advance

mcavic

9:07 pm on Jan 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yep, I see the problem. It must be a bug in IE... Probably nothing you can do except modify the landing page so that you don't need the #.

smagdy

9:32 pm on Jan 1, 2007 (gmt 0)

10+ Year Member



OH, at last somebody belived the bug :)

I cant modify the landing page because, it suppose to scroll down to a field in a form and all elements of the form should appear all the time!

Hope somebody has a fix for that!

eelixduppy

9:45 pm on Jan 1, 2007 (gmt 0)




(Just in IE6 & 7)

I just tried it on my server with IE6 and it works perfectly fine. I'll try some experimenting with it a little later with IE7.

Seems strange...