Click to See Complete Forum and Search --> : ie not loading php script when called
Phill Pafford
08-23-2006, 01:25 PM
In Firefox my php script calls the other php script and it works fine.
In IE when the first php scirpt calls the second I get page not found error.
What gives, Do I need to declare what browser I have?
any suggs,
Thanks :confused:
NogDog
08-23-2006, 01:40 PM
The browser should not matter. The web server which is processing the script does not care what type of browser sent it the HTTP request. I supsect something else is going on, but have no clue what without knowing what exactly you're doing and what the actual scripts look like.
The Little Guy
08-23-2006, 01:43 PM
Its possibly an HTML coding error, or how your calling the script.
Phill Pafford
08-23-2006, 02:59 PM
Sorry, should have posted some code with this.
<html>
<head>
//Some JavaScript Validation, to check the values of the form
</head>
<body>
<form name="myForm" enctype="multipart/form-data" action="sendmail.php", onSubmit="return validate(this);", "<?php echo $_SERVER["PHP_SELF"]; ?>" method="POST">
//Some html form inputs - Just posting the inputs not the whole html code
//The other part of the code is just look and feel
<input type="text" name="email1" size="30">
<input type="text" name="sendto1" size="80">
<input type="text" name="ccemail1" size="80">
<input name="userfile" type="file" id="userfile" />
<input type="radio" name="passopt" value="nopass" checked>
<input type="radio" name="passopt" value="yespass">
<textarea name="message" rows=8 cols=60>
<INPUT TYPE="submit" VALUE="Submit" value="Upload" value=Send File">    <INPUT TYPE="reset">
</body>
</html>
this is the basic funcationality of the first php script, do you see anything that looks wrong that might cause the sendmail.php (Second Script) not to load initially in IE?
Thanks again
chazzy
08-23-2006, 03:24 PM
that's a bad form tag for one...
NogDog
08-23-2006, 03:33 PM
that's a bad form tag for one...
Also, I don't see a closing </form> tag. Validate your mark-up (http://validator.w3.org/), fix any issues, and then I expect all browsers will work the same.
Phill Pafford
08-25-2006, 07:58 AM
OK, Validated the code (I think), but still the same behavior in IE.
SO Im posting the whole code.
First the Javascript.
<html>
<head>
<title>Test Site</title>
<script language="JavaScript" type="text/javascript">
function checkEmail(myForm)
{
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email1.value))
{
return (true);
}
alert("Invalid E-mail Address! Please check your \"FROM\" email addresses and re-enter.");
document.myForm.email1.focus()
return (false);
}
function no_file(myForm)
{
if (myForm.userfile.value == "")
{
alert("Please select a file to upload.");
document.myForm.userfile.focus()
return (false);
}
else
{
return (true);
}
}
function sendto(myForm)
{
if (myForm.sendto1.value != "")
{
var i;
var tsendto = (myForm.sendto1.value);
var sarray = new Array();
var tcount = 0;
var fcount = 0;
sarray = tsendto.split(',');
for (i = 1; i <= sarray.length; i++)
{
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(sarray[i - 1]))
{
tcount++;
}
else
{
alert("Invalid E-mail Address! Please check your \"TO\" email addresses and re-enter. NOTE: If you have multiple email addresses make sure there is \"NO\" space between the comma. EXAMPLE: example@test.com,test@test.com");
fcount++;
document.myForm.sendto1.focus()
return (false);
}
}
if (fcount > 0)
{
alert("Invalid E-mail Address! Please check your \"TO\" email addresses and re-enter. NOTE: If you have multiple email addresses make sure there is \"NO\" space between the comma. EXAMPLE: example@site.com,test@site.com");
document.myForm.sendto1.focus()
return (false);
}
else
{
return (true);
}
}
else
{
alert("There is NO email address in the \"TO\" email text field, Please correct this and re-enter.");
document.myForm.sendto1.focus()
return (false);
}
}
function domain_check_send(myForm)
{
var pattern = /domain_name/;
if (pattern.test("" + myForm.sendto1.value + myForm.email1.value))
{
return (true);
}
else
{
alert("You must have a \"Domiain Name\" email address either in the \"FROM\" or \"TO\" email text feild. EXAMPLE: example@Domain.com");
return (false);
}
}
function allowfile(myForm)
{
//Selecting the last seven characters of the file to be uploaded for validation against allowed file types
//Create an array
var tempcalc = new Array();
//Set value (Path to the file you want to upload)
var tempstr = myForm.userfile.value;
//Get a numeric length of the array
tempcalc = tempstr.length;
//Subtract 7 from the array to create a starting point near the end of the array(string)
var substart = (tempcalc - 7);
//The substart will be 7 characters from the end of the array(string), and then will read the last
//7 characters of the file (plus the path) you want to upload
var extstring = myForm.userfile.value.substr( substart, 7);
//Split the file name from the extenstion name
var file = extstring.split('.');
var validType = false;
//Array of file extensions allowed
//This list can grow to want you want, just add another array element
//If adding to the array (More options) please increase the "notvalid" value in the
//"if" statement in the "for" loop (this should be a negative number, ie: -8 for an array size of 8)
//Also Please update "howto.php" with the added allowed file extension(s)
var allow = new Array();
allow[0] = 'doc';
allow[1] = 'ppt';
allow[2] = 'zip';
allow[3] = 'rar';
allow[4] = 'xls';
allow[5] = 'mdb';
allow[6] = 'pub';
allow[7] = 'pdf';
allow[8] = 'tar';
var fileext = file[1].toLowerCase();
//Counter in the for loop
var notvalid = 0;
for (x in allow)
{
if( fileext == allow[x] )
{
//Must set to false while running the for loop
validType = false;
//Set negative value the same size as the array
notvalid = -9;
}
else
{
//Increment counter if extension is not allowed
validType = false;
notvalid++;
}
}
//This will determine if the extension is acceptable
if (notvalid > 0)
{
alert("Can not upload a file with a: \"" + file[1] + "\" extension. \n\nPlease check the \"Additional Information\" section for a list of extensions that are allowed.");
document.myForm.userfile.focus()
validType = false;
return (false);
}
else
{
validType = true;
return (true);
}
return validType;
}
function validate(myForm)
{
if (no_file(myForm))
{
if (sendto(myForm))
{
if (checkEmail(myForm))
{
if (domain_check_send(myForm))
{
if (allowfile(myForm))
{
return (true);
}
}
}
}
}
return (false);
}
</script>
</head>
Phill Pafford
08-25-2006, 08:07 AM
now the html part
<body>
<form name="myForm" enctype="multipart/form-data" action="sendmail.php" onSubmit="return validate(this);" method="POST">
<table border="0" align="center" width="90%">
<tr>
<td colspan="3">
<table style="background-image: url(images/logo.JPG); background-repeat: no-repeat;" width="100%" align="center">
<tr>
<td> </td>
<td align="center"><font size="5"><strong>Test Site</strong></font></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="center"><font color="red" size="3"><strong>Testing Purposes Only</strong></font></td>
<td> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td colspan="3"> </td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" align="center" width="90%">
<tr>
<td>
<fieldset>
<legend>File Upload Information</legend>
<table border="0" align="center" width="100%" cellspacing="0" cellpadding="0">
<tr bgcolor="#CCCCCC">
<td bgcolor="white" align="right" width="20" height="20"><img src="images/tl.bmp" alt="top left courner"/></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td bgcolor="white" width="20" height="20"><img src="images/tr.bmp" alt="top right corner"/></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="20" height="20"> </td>
<td width="10%" align="right" valign="top"><font color="white"><strong>From</strong></font><font color="#CCCCCC">_</font><font color="white"><strong>Email: </strong></font></td>
<td colspan="2"><input type="text" name="email1" size="30"><br>
<font color="blue" size="2">Note: Please ensure that at least one email text field has a "Domian_Name" address.</font><br><font color="#CCCCCC">_</font></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="20" height="20"> </td>
<td width="10%" align="right" valign="top"><font color="white"><strong>To</strong></font><font color="#CCCCCC">_</font><font color="white"><strong>Email: </strong></font></td>
<td colspan="2"><input type="text" name="sendto1" size="80"><br><font color="blue" size="2">Note: Please enter a "," (comma) with no space between each email address.<br>Example: abc@test.com,def@example.com,etc...</font><br><font color="#CCCCCC">_</font></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="20" height="20"> </td>
<td width="10%" align="right" valign="top"><font color="blue"><strong>*</strong></font><font color="white"><strong>CC</strong></font><font color="#CCCCCC">_</font><font color="white"><strong>Email: </strong></font></td>
<td colspan="2"><input type="text" name="ccemail1" size="80"><br>
<font color="blue" size="2">* <strong>Optional</strong><br>Note: Please enter a "," (comma) with no space between each email address.<br>Example: hig@site.com,kjl@example.com,etc...</font><br><font color="#CCCCCC">_</font></td>
<td> </td>
<td rowspan="3">
<br>
<table border="0" bgcolor="white" align="center" width="215" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#CCCCCC" align="right"><img src="images/itl.bmp" alt="inside top left"/></td>
<td> </td>
<td bgcolor="#CCCCCC" align="right"><img src="images/itr.bmp" alt="inside top right"/></td>
</tr>
<tr>
<td> </td>
<td>
<fieldset>
<legend>Help</legend>
<table width="100%">
<tr>
<td>
For<font color="white">_</font><font color="black">Help</font><font color="white">_</font><font color="black">using</font><br><font color="black">"Domain</font><font color="white">_</font><font color="black">Name</font><font color="white">_</font><font color="black">Test</font><font color="white">_</font><font color="black">Site</font><br><a href="howto.php">Click Here</a>
</td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC" align="right"><img src="images/ibl.bmp" alt="inside bottom left"/></td>
<td> </td>
<td bgcolor="#CCCCCC" align="right"><img src="images/ibr.bmp" alt="inside bottom right"/></td>
</tr>
</table>
</td>
<td> </td>
</tr>
<tr bgcolor="#CCCCCC">
<td> </td>
<td align="right" valign="top"><font color="white"><strong>File: </strong></font></td>
<td colspan="2"><input name="userfile" type="file" id="userfile" /><br><font color="blue" size="2">Note: File size not to exceed 50 Mega Bytes</font><br><font color="#CCCCCC">_</font><br />
</td>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#CCCCCC">
<td> </td>
<td align="right" valign="top"><font color="white"><strong>Password: </strong></font></td>
<td colspan="2"><input type="radio" name="passopt" value="yespass">
Yes, send password in all email(s)
<br>
<input type="radio" name="passopt" value="nopass" checked>
No, send password to "From Email" only
<br><font color="#CCCCCC">_</font></td>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#CCCCCC">
<td> </td>
<td width="10%" align="right" valign="top"><font color="blue"><strong>*</strong></font><font color="white"><strong>Message: </strong></font></td>
<td colspan="2"><font color="blue" size="2"><strong>* Optional  </strong></font>
Message to be included in your email: <br>
<textarea name="message" rows=8 cols=60></textarea>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#CCCCCC">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td bgcolor="white"><img src="images/br.bmp" alt="bottom right"/></td>
</tr>
</table>
</fieldset>
</table>
</form>
</body>
</html>
Sorry this is 2 posts but I wanted all the code up.