/    Sign up×
Community /Pin to ProfileBookmark

hi,

i have the following, in which i am trying to use a variable passed from a previous page:

echo “<a href = ‘REC.php?count=$count&fac=$_GET[fac]&SRG_GROUP=$SRG_GROUP’>VIEW DETAILS</a>”;

even though i am not getting an error message, its still not listing the fac variable passed from the previous page in the url.

not sure if its a mater of syntax or what.

thanks in advance,
geebee

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@skywalker2208Feb 04.2009 — Are you 100&#37; sure the data is being passed? If you are using $_GET then it should be in your url as well like example?fac=something. If it isn't there then most likely that is your problem. You could also try doing a print_r() on the $_GET array to see if it is in there. If the data is not there then I would say it is something from the previous page.
Copy linkTweet thisAlerts:
@geebeeauthorFeb 04.2009 — oops. i got it.. turns out i had the wrong condition...

if(empty($_POST['fac']))

{

echo "<a href = 'REC.php?count=$count&fac=$fac&SRG_GROUP=$SRG_GROUP'>VIEW DETAILS</a>";

}

else

{

echo "<a href = 'REC.php?count=$count&fac=$_
GET[fac]&SRG_GROUP=$SRG_GROUP'>VIEW DETAILS</a>";

}

so i changed it to:

if(empty($_POST['fac']))

{

echo "<a href = 'REC.php?count=$count&fac=$_
GET[fac]&SRG_GROUP=$SRG_GROUP'>VIEW DETAILS</a>";

}

else

{

echo "<a href = 'REC.php?count=$count&fac=$fac&SRG_GROUP=$SRG_GROUP'>VIEW DETAILS</a>";

}
×

Success!

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