/    Sign up×
Community /Pin to ProfileBookmark

Retrieving data from a querystring

i’m sending data to a page thru <a href>.the code goes like dis:
<a href=”abc.php?<?=$rs[$i]?>&stat=edit”>Edit</a>
this link is not in a form.
next i go to the “abc.php” page-
url looks like dis-
abc.php?10&stat=edit

now i need to extract this 10 from the querystring in abc.php.
how do i do this?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@pcthugMay 17.2007 — You must assign the value (10) to a variable. Try:
[code=php]<a href="abc.php?rs=<?=$rs[$i]?>&stat=edit">Edit</a>[/code]
Then the URI will look like [FONT=Courier New]abc.php?rs=10&stat=edit[/FONT]

To retrieve the value use the following php:
[code=php]$_GET['rs']; // 10[/code]
Copy linkTweet thisAlerts:
@engrauthorMay 18.2007 — thanx...but the $_Get does not work on a pws.my alternative was

simply echo $saleN;
×

Success!

Help @engr 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...