By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,441 Members | 996 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,441 IT Pros & Developers. It's quick & easy.

Alert popup in php

P: 1
Hi,
I'm doing a registration form wherein I want to popup a message if a username is already taken. But I have failed and I don't know anymore.

To start, I have 2 files, registration.html where the form is, and query_register.php where the php code for querying the submitted form is.
Here's the php code in query_register.php where I want to popup an alert message that username is already taken.
<?php
...
...
if($count >= 1) { //if username exists in database
header('Location: registration.html');
echo'<script type="text/javascript"> alert(\'Hi\'); </script>';
}
...
...
?>

but it does not work..please help...
Mar 13 '12 #1
Share this Question
Share on Google+
1 Reply


Dormilich
Expert Mod 5K+
P: 8,639
as a side note. a JavaScript popup is done on the client, while PHP is done on the server. so you canít do a popup in PHP.
Mar 14 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.