/    Sign up×
Community /Pin to ProfileBookmark

Storing variable? How to do it?

I have link and I receive number like:
$reactivationnum=$_GET[‘number’];

from link which is sent per e-mail to user:
$contactLink2 = ‘<a href=”http://www….notifification.php?number=’.$reactivationnum.'”>

I have problem that on page is form and when user submits form it will be example error in the fields. How to store $reactivationnum when there is
code in form like <form action=”<?php echo $PHP_SELF; ?>” method=”post” >

After there is shown error it will not be longer correct link

<a href=”http://www….notifification.php?number=’.$reactivationnum.

It will be just notification.php without number.

I would like that it is stored value for number. How to do it because
$reactivationnum is reference to get values for user. If user made mistake it will no longer be $_GET[‘number’] and variable $reactivationnum will be wrong
Beacuse this is code for activation account, I would like to do it with session ID (user can go only once on this link, but if he made mistake in form it will not show him error page and just error message)
Need help. ?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@MatMelDec 04.2006 — If i have understood your problem right, you could either do it like that:

<form action="<?php echo $PHP_SELF . "?number=$reactivationnum"; ?>" method="post" >

then you can receive the form data through POST and the number through GET.

or do it like that:

<form action="<?php echo $PHP_SELF; ?>" method="post" >

<input type="hidden" name="number" value="<?php echo "$reactivationnum"?>">

...

then you would receive the form data AND the number by POST.
×

Success!

Help @toplisek 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,
)...