disdainedangel
New member
I've got an html form which defaults its values to records already in mysql. The form acts just to update the information. The problem is, when I submit the information - the script appends the page to the end of the url instead of posts back to the same page (instead of submitting and posting back to editprofile.php using $_SERVER['PHP_SELF'], it appends it to the url so it looks like editprofile.php/editprofile.php). This results in my getting an error stating, "No Input File Specified". I know this message means the script can't find the action page because of the URL. I've tried adding "../" before the $_SERVER['PHP_SELF'] as well as putting $_SERVER['PHP_SELF'] into a variable and echoing "../" before it but still no luck. What's causing the $_SERVER['PHP_SELF'] to append instead of refresh?
A few snippets from the file:
[....]
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
[.....]
-------------------------
[.....]
$updateGoTo = "../editprofile.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
[......]
----------------------------------
[......]
<form name="form"action="<?php echo $editFormAction; ?>" method="POST">
[......]
A few snippets from the file:
[....]
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
[.....]
-------------------------
[.....]
$updateGoTo = "../editprofile.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
[......]
----------------------------------
[......]
<form name="form"action="<?php echo $editFormAction; ?>" method="POST">
[......]