Jump to content

Why is my browser trying to find a page that doesn't exist


AdRock

Recommended Posts

I am getting really annoyed now becuase all the browsers are trying to find a page whcih doesn't exist

 

I changed my link from edit_profile to editprofile and now it's kicking up a fuss.  It's is still trying to find edit_profile when i click the link

 

If i change the file back to edit_profile.php, I get this error message

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

what on earth is going on?

 

<?php
if(isset($_SESSION["username"])) 
{
     echo "<li><a href=\"editprofile.php\" class=\"nav\">Edit Profile</a></li>";
     echo "<li><a href=\"logout.php\" class=\"nav\">Logout</a></li>";
}
else 
{
     echo "<li><a href=\"register.php\" class=\"nav\">Register</a></li>";
     echo "<li><a href=\"login.php\" class=\"nav\">Login</a></li>";
}
?>

Link to comment
Share on other sites

I tried clearing the cache, reinstalling apache and it even does it on the webserver

 

I removed the page from the directory and changed it all back to normal and it works but that's not the code i want.

 

Here is my editprofile page i want to include...not the old one

 

<?php
    $title = "Register at mycarshare";
    require_once("includes/php/init.php");

    //if the user has already logged in, redirect them to the edit profile page
    if (is_authed_user() || is_authed_admin())
    {
header('Location: login.php');
    }

    require_once('includes/php/validators/ValidateName.php');
    require_once('includes/php/validators/ValidateUsername.php');
    require_once('includes/php/validators/ValidatePassword.php');
    require_once('includes/php/validators/ValidatePostcode.php');
    require_once('includes/php/validators/ValidateTelephone.php');
    require_once('includes/php/validators/ValidatePassword.php');
    //require_once('includes/php/validators/ValidateEmail.php');
    require_once('includes/php/validators/ValidateCaptcha.php');

    // Validate the form
    if ( isset ($_POST['register']) ) {

//variables for checking the user's name
    	$first_name = $_POST['first_name'];
    	$last_name = $_POST['last_name'];

    	//variable for checking the user address and telephone
    	$houseno = $_POST['houseno'];
    	$street = $_POST['street'];
    	$town = $_POST['town'];
    	$county = $_POST['county'];
    	$postcode = $_POST['postcode'];
    	$telephone = $_POST['telephone'];

    	//variables for checking the user's email
    	$email = $_POST['email'];
    	$confemail = $_POST['confemail'];

    	//varaibles for checking the user login credentials
    	$username = $_POST['username'];
    	$pass = $_POST['pass'];
    	$confpass = $_POST['confpass'];

    	// A array to store errors
    	$errors = array();

    	// Collection of validators
    	$validators = array();

    	$validators[]=new ValidateName($_POST['first_name'],'Forename');
    	$validators[]=new ValidateName($_POST['last_name'],'Surname');
    	$validators[]=new ValidateName($_POST['street'],'Street');
    	$validators[]=new ValidateName($_POST['town'],'Town/City');
    	$validators[]=new ValidateName($_POST['county'],'County');
    	$validators[]=new ValidatePostcode($_POST['postcode']);
    	$validators[]=new ValidateTelephone($_POST['telephone']);
    	//$validators[]=new ValidateEmail(array($_POST['email'],$_POST['confemail']));
   	$validators[]=new ValidateUsername($_POST['username']);
    	$validators[]=new ValidatePassword(array($_POST['pass'],$_POST['confpass']));
//$validators[]=new ValidateCaptcha($_POST['verify']);

    	// Iterate over the validators, validating as we go
    	foreach($validators as $validator) {
    if (!$validator->isValid()) {
	while ( $error = $validator->fetch() ) {
                     $errors[]=$error;
            	}
            }
    	}

if(empty($errors)){
    //form is ok so redirect the user to confirmation page
    header('Location: registrationsuccess.php'); 
        }
    }

    //include the header html with menu etc
    require_once("header.inc.php");

    echo ( "<h2>Register at My Car Share</h2><hr /> ");   

    if ( isset($errors) && count($errors) > 0 ) {
    	echo ( "<h2 class='errorhead'>There has been an error:</h2><p><b>You forgot to enter the following field(s)</b></p>" );
    	echo ( "<ul id='validation'>\n" );
    	foreach ( $errors as $error ) {
    	    echo ( "<li>".$error."</li>\n" );
    	}
echo ( "</ul>\n" );
    }
?>
<form method="post" id="registerForm" name="registerForm" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
    <fieldset>
<legend>About You</legend>
<p><label for="first_name">Forename:</label><label id="first_name_msg" class="valid">Required</label>
<input type="text" title="Please enter your first name" id="first_name" name="first_name" size="28" value="<?php echo $first_name; ?>" class="validate required first_name first_name_msg" /></p>

<p><label for="last_name">Surname:</label><label id="last_name_msg" class="valid">Required</label>
<input type="text" title="Please enter your last name" id="last_name" name="last_name" size="28" value="<?php echo $last_name; ?>" class="validate required last_name last_name_msg" /></p>

<p><label for="last_name">House Name/No. :</label><label id="houseno_msg" class="valid">Required</label>
<input type="text" title="Please enter your last name" id="houseno" name="houseno" size="28" value="<?php echo $houseno; ?>" class="validate required houseno houseno_msg" /></p>

<p><label for="last_name">Street:</label><label id="street_msg" class="valid"></label>
<input type="text" <?php error_bool($error, "street"); ?> title="Please enter your last name" id="street" name="street" size="28" value="<?php echo $street; ?>" class="validate notrequired street street_msg" /></p>

<p><label for="last_name">Town/City:</label><label id="town_msg" class="valid">Required</label>
<input type="text" title="Please enter your last name" id="town" name="town" size="28" value="<?php echo $town; ?>" class="validate required town town_msg" /></p>

<p><label for="last_name">County:</label><label id="county_msg" class="valid"></label>
<input type="text" title="Please enter your last name" id="county" name="county" size="28" value="<?php echo $county; ?>" class="validate notrequired county county_msg" /></p>

<p><label for="postcode">Postcode:</label><label id="postcode_msg" class="valid">Required</label>
<input type="text" title="Please enter your last name" id="postcode" name="postcode" size="28" value="<?php echo $postcode; ?>" class="validate required postcode postcode_msg" /></p>

<p class="hint">Please enter a contact telephone number e.g. 01548 342645</p>
<p><label for="telephone">Telephone:</label><label id="telephone_msg" class="valid">Required</label>
<input type="text" title="Please enter your last name" id="telephone" name="telephone" size="28" value="<?php echo $telephone; ?>" class="validate required telephone telephone_msg" /></p>

<p class="hint">Please enter a valid email address for yourself.</p>
<p><label for="email">Email:</label><label id="email_msg" class="valid">Required</label>
<input type="text" title="Please enter your email address" id="email" name="email" size="28" value="<?php echo $email; ?>" class="validate required email email_msg" /></p>

<p><label for="confemail">Confirm Email:</label><label id="confemail_msg" class="valid">Required</label>
<input type="text" title="Please enter your email address" id="confemail" name="confemail" size="28" value="" class="validate required confemail confemail_msg" /></p>
    </fieldset>

    <fieldset>
<legend>Login details</legend>
<p class="hint">Please enter a username for your account. Note that username should be between 4 and 30 characters and no characters other than letters, numbers, hyphens and underscores may be used.</p>
<p><label for="username">Username:</label><label id="username_msg" class="valid">Required</label>
<input type="text" title="Please enter a username" id="username" name="username" size="28" value="<?php echo $username; ?>" class="validate required username username_msg" /></p>

<p class="hint">Please enter a password for your user account. Note that passwords are case-sensitive. The password must contain at least 6 and no more than 15 characters and no characters other than letters, numbers and underscores may be used</p>
<p><label for="pass">Password:</label><label id="password_msg" class="valid">Required</label>
<input type="password" title="Please enter a password" id="pass" name="pass" size="28" class="validate required pass pass_msg" /></p>

<p><label for="confpass">Confirm password:</label><label id="confpass_msg" class="valid">Required</label>
<input type="password" title="Please re-enter password" id="confpass" name="confpass" size="28" class="validate required confpass confpass_msg" /></p>
    </fieldset>
    <fieldset>
<legend>Image Verification</legend>
    	<p class="hint">Please enter the text that you see in the image into the box below. You are asked to do this in order to verify that this registration is not being performed by an automated process. </p>
    	<div class="captcha2"><img src="includes/php/captcha.php" alt="captcha image" /></div>
    	<p><label for="verify">Anti-Spam key:</label><label id="verify_msg" class="valid">Required</label>
    	<input type="text" title="Please enter the image text" name="verify" id="verify" size="25" class="validate required verify verfify_msg" /></p>
    </fieldset>
    <p><label for="Submit" style="width: 80px"> </label>
    <input type="submit" name="register" value="Update My Profile" class="sendbutton" style="width: 200px"/>
    <input type="reset" value="Reset Fields" class="sendbutton" style="width: 120px"/></p>
</form>
<?php
    //include the closing html
    require_once("footer.inc.php");
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.