2012-09-15 93 views
1

嗨已經得到陷入一個進退兩難的地方,我目前正在建設一個獎品類型的網站,並希望火了一個形式的URL,但由於某些原因不能正常工作之間!這是我的代碼邏輯:如何斷火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

從$ logOptions_id; 來... ...? – Gautam3164

+0

checkuserlog.php,它是一個檢查用戶會話等的文件。 – James

回答

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 
+0

因爲它已經是元素的腳本屬性,所以不需要添加'javascript:'(甚至不能確定它不會打破它)。上面代碼中的問題我認爲是''''''''''''''''''''''''''''''''''''''''''我相信''' –