For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > March 2007 > Re: [PHP-DB] Embedded php in javascript









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] Embedded php in javascript
bedul

2007-03-25, 9:57 pm

i think u have mistaken using javascript
----- Original Message -----
From: "Onochie Anyanetu" <ubernoch@gmail.com>
To: <php-db@lists.php.net>
Sent: Friday, March 23, 2007 8:38 AM
Subject: [PHP-DB] Embedded php in javascript


> Hi, I am trying to create a pop up alert warning for deleting an entry in

my
> database. What I have is:
>
> <form name=myform>
> <input type=button value="Delete Venue" onClick="if(confirm('Are you sure

in on click.. u may trap em by execute a function or procedure.

====================================[col
or=darkred]
> you want to delete ID # <? echo "$UID"; ?>? There is no undo.'))
> {alert('Value deleted<? mysql_query("DELETE from table where ID =[/color]
'$UID'");
> ?>')}
> else
> {alert('no changes')}">
> </form>

remember one things.. by click it u execute the script to del.. u should add
this
return false;

==========================
>
> The problem here is that the embedded php is run regardless of if the user
> clicks no, for example if i put php in both the if and the else they will
> both be executed. So does anyone have and idea how to make this work or
> another workaround?
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com