/    Sign up×
Community /Pin to ProfileBookmark

Loading page and using POST to send variables.

Daer ladies and gentlemen

I happen to have this piece of code in my website.

<!–//
window.location.replace(“bet_ins.php”);
//–>
</script>

That works really good. But I need to tranfer some variables in this form.

window.location.replace(“bet_ins.php?id=<? echo $id ?>”);

But it wont work. Can you please help me?
I am a PHP developer and I am making just my first steps in JS coding

Thank you

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Mr_JJan 20.2005 — As unfamiliar with PHP that I am I'd like to have a try at solving this by asking you to try one of the following


window.location.replace("bet_ins.php?id=<?"+echo $id+"?>");

or

window.location.replace("bet_ins.php?id=<? echo"+$id+"?>");

sorry if this does not help
Copy linkTweet thisAlerts:
@scragarJan 20.2005 — [code=php]<?
echo "window.location.replace("bet_ins.php?id=$id");";
?>[/code]


OR

[code=php]
window.location.replace("bet_ins.php?id=<? echo "$id"; ?>");
[/code]
Copy linkTweet thisAlerts:
@lordcelebornauthorJan 21.2005 — Thank you very much.

Finally this was the answer to the problem. I thank you both.

<script>

<!--//

window.location.replace("parchment_show.php?id=<? echo "$pid"; ?>");

//-->

</script>
×

Success!

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