close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

HELP - How to clear the URL PAR

Thread began 6/14/2011 4:20 pm by hbibizadeh396670 | Last modified 6/16/2011 10:32 am by Jason Byrnes | 1749 views | 6 replies |

hbibizadeh396670

HELP - How to clear the URL PAR

I built a user registration system for my eCart.

However I have a small issue.

I am using a simple show if which allows me to show an error message if the username is already taken.


<?php if(isset($_GET['BadUserName']) && $_GET['BadUserName'] == "1") { ?>
<div id="RegFailDIV">UserName is Taken. Please Try Another.</div>
<div id="LoginFailDIV"></div>
<?php } ?>

The issue is cause by the fact that my form can fail for multiple reasons. For example captcha is wrong.

The issue arises when the username box displays, if a user re types the form with a available username, submits the form, if the form fails for a different reason, and returns to the page, the username box still appears, because the URL par has not been removed.

Could you tell me how to clear the URL PAR when the form is re-submitted.

Also,

I need to make my passwords encrypted.

Although I know how to do this and make it work with my login and registration pages. I do not know how to make email password work. This is because the email password would email the encrypted password in its default state.

Could you tell me how to do this.


Thank you.

Sign in to reply to this post

hbibizadeh396670

Is this possible

Sign in to reply to this post

Jason ByrnesWebAssist

add the following code just before the form tag on the login page to strip the BadUserName querystering variable if it exists:

php:
<?php
if(isset($_SERVER["QUERY_STRING"])) {
    
$arrQS explode("&"$_SERVER["QUERY_STRING"]);
    foreach(
$arrQS as $k => $v) {
        if(
$v == "BadUserName=1") unset($arrQS[$k]);
    }
    
$_SERVER["QUERY_STRING"] = implode("&"$arrQS);
}
?>




for the email pass word, edit the email passwrd server behavior, remove the reference to the password database column, then click the plus button and select the NewPW session variable.

Sign in to reply to this post

hbibizadeh396670

Ok,

I have made the Email PW work fine. (Thank you)

However I still cannot fix my URL Issue. And I did add your code above.

To help you, please use the below link and follow my instructions to re-create my issue.

Registration.php?BadUserName=1&requsername=AshleyBibizadeh

I have included the URL Par which is causing the problem in the URL. This way the UserName is not available Message will show immediately for you.

To re-create the problem, please fill in the form fields with values, and a different username which is available (Example sdfhsd) and enter a WRONG captcha code.

This means that although the UserName is available, and the form has returned to the page for a different error.

It still displays the UserName Error Message. (Which Is Ny Issue)

This is because the URL Par is still present in the URL.

Could you please help me solve this.

Thank you in advance.

Sign in to reply to this post

Jason ByrnesWebAssist

did you add the code from my previous reply?

Please send a copy of your page so i can see the code.

Sign in to reply to this post

hbibizadeh396670

Sure.

I added the code, but have not had any luck.

Could you delete the attachment from this post when you have it?

Thank you.

Sign in to reply to this post

Jason ByrnesWebAssist

I see, change line 73 - 79:

php:
<?php

$editFormAction 
$_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING'])) {
  
$editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
}

?>




to:

php:
<?php

$editFormAction 
$_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING'])) {
    
$arrQS explode("&"$_SERVER["QUERY_STRING"]);
    foreach(
$arrQS as $k => $v) {
        if(
$v == "BadUserName=1") unset($arrQS[$k]);
    }
    
$strQS implode("&"$arrQS);
  
$editFormAction .= "?" htmlentities($strQS);
}

?>
Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...