/    Sign up×
Community /Pin to ProfileBookmark

question about $_GET

Say I have a url that looks like this:

firmancomputers.com/display.php?Link_Num=9&action=5

but sometimes the url only looks like this:

firmancomputers.com/display.php?action=5

In a PHP program.. How can I do something like:

[B]if ($_GET[‘Link_Num’] == “”) {[/B]

It does not like the code I put. Any input would be great.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@The_Little_GuyJul 20.2006 — [code=php]if ($_GET['Link_Num'] == 5) {
echo 'Link Number: 5'
}[/code]
Copy linkTweet thisAlerts:
@firmanauthorJul 20.2006 — Thanks for answering TLG

but I want to do something that is ....


If Link_Num is not in the url...do this
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYJul 20.2006 — [code=php]
<?php
if(!isset($_GET['Link_Num']) || empty($_GET['Link_Num'])){
# Just do it ;)
}
?>
[/code]


do you GET it ? :p tell me if you need further explanations
×

Success!

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