open a message window by php ???

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

User avatar
quantm
New php-forum User
New php-forum User
Posts: 7
Joined: Mon Apr 07, 2003 8:00 pm
Location: Vietnam

open a message window by php ???

Postby quantm » Mon May 05, 2003 1:58 am

Can anyone tell me if PHP could open a message window (as in Windows OS) (not a new window in IE), in which it could ask user for a choice (yes or no for example)

Thank you for your help in advance!
8O

User avatar
mike
New php-forum User
New php-forum User
Posts: 73
Joined: Sun May 04, 2003 4:26 am
Location: Athens
Contact:

Postby mike » Mon May 05, 2003 2:06 am

As far as I know this can be done only with Java not PHP.

User avatar
quantm
New php-forum User
New php-forum User
Posts: 7
Joined: Mon Apr 07, 2003 8:00 pm
Location: Vietnam

my problem!!!

Postby quantm » Mon May 05, 2003 7:37 pm

I have a php page (called main.php) in which there is a link (using tag <a...>) in order for users to delete an item in table.
I want it operate as follow:
First, this page will be tranfer a variable call 'action' with the value 'view' in order for users to view all records in a database.
(In this view there is a link, said above, for each record)

When user click on that link, a message window will appear requiring user confirmation. If they click yes, I want to tranfer a variable called 'action' with the value 'delete' to this right page (main.php), because codes for handling view and delete action are both in the main.php file.

So what i have to do in this situation, php or javascript, or how they could interact with each other.

8O

mudkicker
New php-forum User
New php-forum User
Posts: 7
Joined: Fri May 09, 2003 7:31 am

Postby mudkicker » Fri May 09, 2003 7:45 am

<?
if ($submit = "Do it!")
{

if ($conf== "no")
{
echo "<br><br><br><br><br><br><br><center>Click <a href='admin.php'>here</a> to go back to the admin page.</b></center>";
}

else {

if ($conf == "ok")
{
$sql="DELETE FROM tbl_rec WHERE id='$id'";

$connect= @mysql_connect("localhost","$dbname","$dbpass");

if(!$connect)
{
echo "Cannot connect to the server! Please try again later.";
exit();
}

if (!@mysql_select_db("db_cv",$connect))
{
echo "Cannot connect to the database! Please try again later.";
exit();
}

$query=@mysql_query($sql,$connect);

if (!$query)
{
echo "<center><h2>Wrong SQL Query!</h2><br><h3>You See This Messeage Because You Have <font color=red size='+6'><u>NO PERMISSION</u></font> To Use This Option!</h3><br><a href='$HTTP_REFERER'>Click here to go back</a></center>";
exit();
}
else {
echo "<br><br><br><br><br><br><br><center><b>Contact info removed successfully.
Click <a href='admin.php'>here</a> to go back to the admin page.</b></center>";
}
}

else
{
?>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table align="right" bgcolor="#808080" cellspacing="0" cellpadding="0">
<tr>
<td><img src="menu_left_curve.gif" width="121" height="38"></td>
<td width=170><div align="center"><font class="b">Welcome, <? echo $uname; ?><br>You logged on <font class="a"><? echo date("d-m-Y H:i"); ?></font></font></div></td>
<td width=150><div align="center"><a class="arif" href="logout.php">Logout <? echo $uname; ?></a></div></td>
<td width=70><div align="center"><a class="arif" href="add.php">Add</a></div></td>
<td width=70><div align="center"><a class="arif" href="edit.php">Edit</a></div></td>
<td width=70><div align="center"><a class="arif" href="remove.php">Remove</a></div></td>
<td width=70><div align="center"><a class="arif" href="browse.php">Browse</a></div></td>
<td><a href="admin.php"><img src="db_logo_with_background.gif" width="160" height="38" border="0" alt="Click here to go to admin page."></a></td>
</tr>
</table>
<br><br><br><br><br><br><br><br><br>
<form action="<? echo "$PHP_SELF"; ?>" method="post">
<input type="hidden" name="id" value="<? echo "$id"; ?>">
<table align="center" bgcolor="#D3D3D3" cellspacing="2" cellpadding="2" border="1">
<tr>
<td colspan="2"><div align="center">CONFIRM DELETE PROCESS...</div></td>
</tr>
<tr>
<td colspan="2"><input type="radio" name="conf" value="ok">&&OK! Delete it!</td>
</tr>
<tr>
<td colspan="2"><input type="radio" name="conf" value="no" checked>&&NO! Don't delete the entry.</td>
</tr>
<tr>
<td colspan="2"><div align="center"><input type="submit" name="submit" value="Do it!"></div></td>
</tr>
</table>
</form>
</body></html>
<?
}
}
}
?>

mudkicker
New php-forum User
New php-forum User
Posts: 7
Joined: Fri May 09, 2003 7:31 am

Postby mudkicker » Fri May 09, 2003 7:46 am

You can do this in a HTML page as i sent here. i think this is much cooler than this crappy windows. :lol:


Return to “PHP coding => General”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest