/    Sign up×
Community /Pin to ProfileBookmark

hyperlink doubt

Hi guys.

can u guys take a look at my code.. my output is not as i expected…

my output:
Are you sure want to reset the counter ?
“>Yes | Back to main

my code:
echo ‘Are you sure want to reset the counter ?<br>’;
echo ‘<a href=”./reset-counter.php?reset=yes&type=<?echo $type?>”>Yes</a> | <a href=”./main.php”> Back to main </a>’;

did i miss something in my code ?? in the a href part, even i didn’t put this ./, the result still the same.

please advise.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@DJsACFeb 11.2004 — [i]Originally posted by Alicia [/i]

Hi guys.

can u guys take a look at my code.. my output is not as i expected...

my output:

Are you sure want to reset the counter ?

">Yes | Back to main

my code:

echo 'Are you sure want to reset the counter ?<br>';

echo '<a href="./reset-counter.php?reset=yes&type=[B]<?echo $type?>[/B]">Yes</a> | <a href="./main.php"> Back to main </a>';

did i miss something in my code ?? in the a href part, even i didn't put this ./, the result still the same.

please advise. [/QUOTE]

<?echo $type?> is not necessary, just write &type=$type

The echo statement automatically inserts the variables. no need for a <? echo $ ?> tag.
Copy linkTweet thisAlerts:
@AliciaauthorFeb 11.2004 — but why when the time i press on the hyperlink, it shows ./ instead of the current folder the file is saved ??

my file name is "remove.php" inside "records" folder... by assuming that my domain is "myweb.com", when i put ./main.php.,, shouldn't it link to www.myweb.com/records/main.php ??? but why it shows http://www.myweb.com/"./main.php/" at the moment..

is there any prob with my code ???

please advise.
Copy linkTweet thisAlerts:
@SamFeb 11.2004 — 
<a href="./main.php">
[/quote]

there's no need for ./ the interpreter will always default to the current working directory. also, since you started with a ' instead of a " you don't need to escape the "s, you can use

<a href="main.php">

without a problem
×

Success!

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