Jump to content

$_post errors, works in FF, not in IE8


lupld

Recommended Posts

Ok, doing a satire project where I'm mocking an IE8 opening a url and it being blocked to do government zealotry.

I have it all about done, but I want to make two versions, an internet emulator, and the redirect one I just mentioned. It works in firefox, but in IE8 it acts as if the submit button wasn't pressed when it loads the page.

 

I think it's an error with how I handled the form, or the $_POST in php. Anyone know why this works in Firefox exactly how it should and not at all in IE8? I thought php handling was browser independant, it should grab the $_POST, put the links in how it should, and load the "fake browser".

 

Here are all the files, this is just a school project, and I don't care who rips off the code, I think it's a neat little project.

 

Here is the code just in case someone is curious and doesn't wanna download the source files..

<?php
if(isset($_POST['Submit'])) 
{
	$url = $_POST['URL'];
}else{
	$url = "http://www.google.com";
}
if(stristr($url,"http://")){
}else{
$url = "http://".$url;
} 
?>

<html>
<div id="IE-LOGIN"><form method="post" action="index.php">
<input id="IE-LOGIN-INPUT" type="text" name="URL" value="<?php PRINT "$url"; ?>" />
<input type="submit" value="Submit" name="Submit" style="display:none;" />
</form>
</div>
</html>

On a side note, could this be IE8's anti-phishing software? I just need it to work for a school project, if I have to use Firefox in the end, I suppose I will, but it will be easier not to install a new browser just to turn in the project.

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/194581-_post-errors-works-in-ff-not-in-ie8/
Share on other sites

This is probably terribly coded, but it works. Use index.php?durl=yahoo.com or google.com or something to load the page the first time.

Then after that the form works fine for both.

Here is the final PHP

<?php
//if(isset($_POST['Submit'])) 
//	{
	$dlin = $_POST['dlin'];
//	}else{
//		$dlin = "http://www.google.com";
//	}

if(isset($_GET['durl'])){
	$url2 = $_GET['durl'];
	if(stristr($url2,"http://")){
	}else{
	$url2 = "http://".$url2;
	} 
}else{
	if(stristr($dlin,"http://")){
	}else{
	$dlin = "http://".$dlin;
	}
}
?>

And the places the link needs to be included now look like this...

<?php PRINT "$dlin"; PRINT "$url2"; ?>

 

and cause I'm a nice guy, and I like this little project, here, have the newly finished index.php

 

[attachment deleted by admin]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.