/    Sign up×
Community /Pin to ProfileBookmark

Error with Java script redirect in PHP. Please Help!

I have this little javascript inserted in my php file which redirect the user and tag along a few variables, it works, but I also get an error on the file line number 276, 27 character, ‘;’ expected. Line 276 is where the java script starts. Can someone take a look to see what I am overlooking?
?>
<script language=”JavaScript”>
var pwd = “<?php echo “md5(“.$_POST[‘passwd’].”)”; ?>”;
var cust = “<?php echo ‘Existing Customer’; ?>”;
var email = “<?php echo “”.$_
POST[’email’].””; ?>”; parent.location.href=”suw_5.php?cust_status=”+cust+”&email=”+email+”&cust_pwd=”+pwd;
</script><?php

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMar 03.2005 — Try it this way:
[code=php]
...
?>
<script language="JavaScript">
var pwd = "<?=md5($_POST['passwd'])?>";
var cust = "<?='Existing Customer'?>";
var email = "<?=$_POST['email']?>";
parent.location.href = "suw_5.php?cust_status=" + cust + "&email=" + email + "&cust_pwd=" + pwd;
</script>
<?php
...
[/code]
×

Success!

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