/    Sign up×
Community /Pin to ProfileBookmark

I’ve to create a registration form that redirect to a page after registration

Hi
i’ve a page called registration.html that contains a form. I want that when the user click the “send” button, he will be redirected to the page called confirmRegistration.html
… But how to exlude the possibility of open this page writing manually the address into the address bar? (for exemple [url]www.mysite.com/confirmRegistration.html[/url])

What approach you would use? Is it the case of use the SESSIONS?

to post a comment
HTML

6 Comments(s)

Copy linkTweet thisAlerts:
@simplypixieApr 13.2013 — Your confirmRegistration page needs to be a .php, not a .html (unless you are making changes in htaccess) and then at the top of the page you would put something like this (difficult without your code):

[code=php]<?php
if (!isset($_POST)) {
header('location: name_of_page_to_redirect_to');
} else {
.
.
.
// The form processing code here
.
.
} ?>
[/code]
Copy linkTweet thisAlerts:
@American_horizoauthorApr 13.2013 — uhmm,

if !isset($_POST) it should return to the registration page with the form

ELSE he should show the confirmation that is something like this.

<div>You're successfully registred. Please Check your mail</div>

In the php code can i put this html code after the ELSE? Note that i won't generate it trought php echo, but treat it such a normal html code
Copy linkTweet thisAlerts:
@Major_PayneApr 15.2013 — This site will set it up very easy. Just plug in what is asked for in each step. Make sure you have the name of your files:

http://www.thesitewizard.com/wizards/feedbackform.shtml


PHP: Sending Email Tutorial (Text/HTML/Attachments): http://www.webcheatsheet.com/php/send_email_text_html_attachment.php

How to Code a Sign Up Form with Email Confirmation: http://net.tutsplus.com/tutorials/php/create-a-signup-form-with-email-confirmation/

CoffeeCup Free Web Form Builder (Win/Mac Versions): http://www.coffeecup.com/web-form-builder-lite/
Copy linkTweet thisAlerts:
@American_horizoauthorApr 19.2013 — Your confirmRegistration page needs to be a .php, not a .html (unless you are making changes in htaccess) and then at the top of the page you would put something like this (difficult without your code):

[code=php]<?php
if (!isset($_POST)) {
header('location: name_of_page_to_redirect_to');
} else {
.
.
.
// The form processing code here
.
.
} ?>
[/code]
[/QUOTE]


Actually i've use your method, with the difference that the exact syntax is [B]if (empty($_POST))[/B], because the $_POST is a superglobal variable that is always set

But now i don't know how to proceed.

My php page is that:

[code=php]

<?php

if (empty($_POST))
{
header('location: loginPage.php');
}

?>

<div id="logo"> <img src=my_logo_small_grey.png height="60"/> </div>
<div id="msgConfirm">Thank You!</div>


</body>

[/code]


But how to launch it passing a POST parameter? What method should i adopt? Actually i've tryied with AJAX ajaxReq.open("POST", url, true), but it don't open the page
Copy linkTweet thisAlerts:
@simplypixieApr 23.2013 — OK, I should have been a bit more specific regarding the isset (better to use than empty on its own) and I would normally have a hidden input field in my forms to check that the form has been posted, so something like[code=php]if (!isset($_POST['confirm_login'])) {
...
}[/code]

I am not 100% sure I understand your question but I think you are trying to pass a parameter back to the login page if the person is redirected (maybe an error code), so:

[code=php]if (!isset($_POST['confirm_login'])) {
header('location: loginPage.php?error=1');
}[/code]


I could help better if you could tell me exactly what information you want to send back to the login page on the header re-direct.
Copy linkTweet thisAlerts:
@American_horizoauthorApr 23.2013 — yes this could be a solution
×

Success!

Help @American_horizo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...