如何启动URL

时间:2012-09-15 09:56:33

标签: php html parsing url

嗨,大家好被困在一块岩石和一个坚硬的地方之间,我现在正在建立一个奖品类型的网站,并希望以一种形式发布网址,但由于某种原因,没有工作!这是我的代码逻辑:

<?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>

1 个答案:

答案 0 :(得分: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