Re: dynamic button not working



Rik wrote:
On Thu, 26 Jul 2007 19:05:32 +0200, tomb <tomb@xxxxxxxxxxxxxxxxx> wrote:
Rik,
Thank you for such an informative and complete response. You actually led me to the real problem and, yes, it is PHP related. When I capture the actual response from my PHP script, I see all my quote marks are escaped with \., which I am doing when I build the response string.

Ah, so the problem with the form was an HTML problem. The cause of the HTML problem is actually faulty PHP-script.

I didn't think they would still be there when it reached my browser. Is there something I can do in my PHP script prior to returning the HTML string that will strip those slashes?

Don't have those slashes in there at all I'd say.

I also tried changing my code to single quotes around the entire string, and double quotes only - no slashes - around the element values, but it still comes to my browser with the slashes at the double-quotes. ???

That shouldn't happen, unless you run some code over the response string by accident. Might wee see an extract of your code?

--Rik Wasmus
I verified that magic_quotes_sybase is off, and magic_quotes_gpc is on. According to the php manual, I should be able to use stripslashes() to resolve this, but it isn't doing anything. So, I am gladly posting my code for you to critique. I only included the txtCompany text box for brevity. Even though I took out all the slashes, they are all there when it reached my browser.

if($row){
$output = '<table class="clientdata"><tr><td>' . $row['name'] . '<br />&nbsp;</td></tr>';
$output = $output . '<tr><td><form name="clientform" id="clientform"><table>';
$output = $output . '<tr><td>Name:</td><td><input id="txtCompany" name="txtCompany" type="text" size="65" value="' . $row['name'] . '" /></td></tr>';
$output = $output . '<tr><td colspan="2">';
$output = $output . '<input id="add" name="add" type="button" value="Add" onClick="addThisClient(' .$row['tid'] . ',' . $row['id'] . ');" />';
$output = $output . '<input id="update" name="update" type="button" value="Update" onClick="updateThisClient(' .$row['tid'] . ',' . $row['id'] . ');" />';
$output = $output . '<input id="delete" name="delete" type="button" value="Delete" onClick="deleteThisClient(' .$row['tid'] . ',' . $row['id'] . ');" />';
$output = $output . '<input type="reset" value="Clear" /></td></tr>';
$output = $output . '</table></form></td></tr></table>';
echo $output;
}

Makes no sense to me, I hope it does to you. Thanks so much for taking your time on this.

Tom
.



Relevant Pages

  • Re: dynamic button not working
    ... Thank you for such an informative and complete response. ... You actually led me to the real problem and, yes, it is PHP related. ... The cause of the HTML problem is actually faulty PHP-script. ... Is there something I can do in my PHP script prior to returning the HTML string that will strip those slashes? ...
    (comp.lang.php)
  • Re: Post with redirect?
    ... How can I force a POST but actually redirect the user as well ... and it can't be done with PHP. ... return $response; ... its a credit card entry form on a completely separate server. ...
    (comp.lang.php)
  • Re: replace single slash with double slash
    ... but it seems to be very difficult replacing slashes. ... you must write each slash twice because of php escaping rules. ... These file paths are coming from a database, ... This doesn't matter where the string comes from. ...
    (comp.lang.php)
  • RE: Please Help: Posting and redirecting to another form.
    ... > I suppose the key point is to put Response content from ... > // Get stream of php page Response ... (Response.redirect only shows the login page ... >>StreamWriter stOut = new StreamWriter ...
    (microsoft.public.dotnet.framework.aspnet)
  • Please Help: Posting and redirecting to another form.
    ... I suppose the key point is to put Response content from ... php page (HttpWebResponse) into Response of your page ... // Get stream of php page Response ... (Response.redirect only shows the login page ...
    (microsoft.public.dotnet.framework.aspnet)