1

嗨,伙计们陷入了困境,我目前正在建立一个奖品类型的网站,并希望以某种形式触发网址,但由于某种原因无法正常工作!这是我的代码逻辑:

<?php

$id = $logOptions_id;

$title = "";

$firstname = "";

$lastname = "";

$gender = "";

$email = "";

$housenumber = "";

$addressone = "";

$addresstwo = "";

$county = "";

$city = "";

$country = "";

$birthday = "";

$phone = "";

$postcode = "";



$ipaddress = getenv('REMOTE_ADDR');



$sql = mysql_query("SELECT * FROM myMembers WHERE id='$id' LIMIT 1");

while($row = mysql_fetch_array($sql)){

    $title = $row["title"];

    $firstname = $row["firstname"];

    $lastname = $row["lastname"];

    $gender = $row["gender"];

    $email = $row["email"];

    $housenumber = $row["housenumber"];

    $addressone = $row["addressone"];

    $addresstwo = $row["addresstwo"];

    $county = $row["county"];

    $city = $row["city"];

    $country = $row["country"];

    $birthday = $row["birthday"];

    $phone = $row["phone"];

    $postcode = $row["postcode"];

}

?>

在我的html中我有这个....

<form id="coregOffer" action="path.php" method="post">

<table width="100%" border="0" id="coregTable">

<tr>

<td>

<table width="95%" border="0" align="center" cellpadding="5">

<tr>

<td width="24%" align="center" valign="top"><img src="images/tesco.png" width="212" height="107" alt="Tesco Offer"></td>

<td width="76%" align="left" valign="top"></td>

</tr>

<tr>

<td colspan="2">

<br/>

Accept This Offer?

<input type="radio" value="yes" checked id="yes" onClick=\"location.href='http://www.somesite.com/feeds?&mg_site_id=1&mg_comp_id=1087&mg_terms_and_conditions=on&mg_cid=101&mg_ip=<?php echo $ipaddress; ?>&title=<?php echo $title; ?>&firstname=<?php echo $firstname; ?>&email=<?php echo $email; ?>'\" />Yes

<input type="radio" value="no" id="no" />No

</td>

</tr>

</table>

<table width="95%" border="0" align="center" cellpadding="5" id="coregTable2">

<tr>

<td width="24%" align="center" valign="top"><img src="images/PMOffer.png" width="213" height="108" alt="OfferPlaceholder"></td>

<td width="76%" align="left" valign="top"></td>

</tr>

<tr>

<td colspan="2">

<br/>

Accept This Offer?

<input type="radio" value="yes" checked id="yes" onClick=\"location.href='http://www.somesite.com/public/postlead.php?campaign=438&publisher=1322&adgroup=848&ip=<?php echo '$ipaddress'; ?>&field1=<?php echo '$title'; ?>&field14=<?php echo '$gender'; ?>&field2=<?php echo '$firstname'; ?>&field3=<?php echo '$lastname'; ?>&field4=<?php echo '$addressone';?>&field6=<?php echo '$city'; ?>&field8=<?php echo'$postcode'; ?>&field9=<?php echo '$phone';?>&field10=<?php echo '$email'; ?>&field18=<?php echo'$birthday'; ?>&field20=<?php echo 'now()'; ?>&source=123'\" />Yes

<input type="radio" value="no" id="no" />No

</td>

</tr>

</table></td>

</tr>

<tr>

<td align="center" valign="top">

<input type="submit" id="submit" value="Submit" /> 

</td>

</tr>

</table>

</form>
4

1 回答 1

1

尝试这个,

onClick="javascript:window.location.href='http://www.somesite.com/feeds?&mg_site_id=1&mg_comp_id=1087&mg_terms_and_conditions=on&mg_cid=101&mg_ip=<?php echo @$ipaddress; ?>&title=<?php echo @$title; ?>&firstname=<?php echo @$firstname; ?>&email=<?php echo @$email; ?>'" />Yes
于 2012-09-15T10:08:08.090 回答