how to open confirm box in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
raj86
Forum Commoner
Posts: 25
Joined: Tue Sep 29, 2009 12:28 am

how to open confirm box in php

Post by raj86 »

Hello friends
i want to geneate a popup / confirm box when all the data are inserted in the data base

like :
$query= insert into......
$result = mysql_query($query) or die ("Error in query: $query");
if($result)
{

//Here i want to code such a way that it should show a confirm box having OK/CANCEL options
i.e confirm ("Are the entries correct.");


for that i am using below code but its not working....can anyone tell me how to show a confrim box or a popup.

echo "function popup(){";
echo "<script language='javascript' >";
echo "function newPopup(url) {";
echo "popupWindow = window.open('http://localhost/team-1/popup.php','pop ... =10,top=10)";
echo "}";
echo "</script>";
}
thank you
uyewq
Forum Newbie
Posts: 22
Joined: Thu Sep 17, 2009 6:21 am

Re: how to open confirm box in php

Post by uyewq »

Hi raj86,
maybe you should try these 2 steps

1 - be sure that your javascript is working. Try it in a draft html file. if you become sure try step 2
2 - you may change your codification like below: (paste your working js exactly same. again if there is smthing wrong, you should suspect your php code)

Code: Select all

 
$query= insert into......
$result = mysql_query($query) or die ("Error in query: $query");
if($result)
{
 
//Here i want to code such a way that it should show a confirm box having OK/CANCEL options
i.e confirm ("Are the entries correct.");
 
for that i am using below code but its not working....can anyone tell me how to show a confrim box or a popup.
[color=#FF0000][b]?>[/b][/color]
function popup()
<script language='javascript'>
function newPopup(url) 
popupWindow = window.open('http://localhost/team-1/popup.php','popUpWindow',height=500,width=300,left=10,top=10)"
</script>[color=#FF0000][b]<?php[/b][/color]
}
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: how to open confirm box in php

Post by jackpf »

This isn't PHP.
John.Mike
Forum Newbie
Posts: 18
Joined: Fri Sep 04, 2009 11:43 pm
Location: Canton.China

Re: how to open confirm box in php

Post by John.Mike »

jackpf wrote:This isn't PHP.
Suggest that a hidden box is needed,u can use the "thickBox",i think it's impossible to open a confim box with php only,cuz php is a server based language,lol.. :)
Post Reply