Hi i was wondering if anyone could point out what im doing wrong here im as im new to this function and relatively new to PHP
$quotes = array(",","\"","'","*");
//above is array that i need to be escaped
while ($result = mysql_fetch_array($query)){
echo (" <tr>
<td> </td>
<td>Question</td>
<td colspan='6'>".substr($result['question'],0,50).".....</td>
</tr>
<tr>
<td width='28'> </td>
<td><A HREF='javascript:popUp(\"../admin/edit-poll.php?id=".$result['Id']."&question=".$result['question']."&opt1=".$result['choice1']."&opt2=".$result['choice2']."&opt3=".$result['choice3']."\")'>Edit This Poll</td>
</tr>
<td colspan='6'> </td>
<td width='6' colspan='-1'> </td>
<td width='12'> </td>
</tr>");
Ok with the above script i need to substr and str_replace on the $result['question'] so it shows only 50 characters which i have working but how do i add a str_replace to that currentt script?as what happen is if the $result[question has a ' or a , or " it gets parsed through php and will not open the popup window with the edit form on it.
This is the code parts that i think need editing
<td colspan='6'>".substr($result['question'],0,50).".....</td>
//display the first 50 chars of poll question
question=".$result['question']."&
//send question to address bar to be accessed by edit form
Kind regards Pinky