473,387 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Alert popup in php

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
1 1914
Dormilich
8,658 Expert Mod 8TB
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

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

Similar topics

2
by: Keith | last post by:
I have a session variable set on my main page which works fine, I also have a popup window called from a text link via javascript. For some reason the session variable is not available on the...
4
by: SibAndela | last post by:
Two little challenges: 1. I would like to achieve the equivalent of a client side javascript alert popup from server side code. Any suggestion how I can do this? 2. How can I cause a beep at...
13
by: dave yan | last post by:
hi, i have some forms which use javascript for data validation, e.g., checking to make sure all required fields are completed, checking that data falls within valid ranges for certain fields,...
1
by: Stuart Palmer | last post by:
Hi everyone, I am doing a page for an Israeli customer and doing a form validator with a javascript alert popup for errors listing the fields missed, line by line. When this pops up the text is...
0
by: atif | last post by:
i m working on an online MIS n i need help on how to generate the alert popup's like v used to hav in MSN messenger when v received a mail or someone's comes online. Thanx ----== Posted via...
1
by: MC | last post by:
Hi, I want to use MS Messenger in order to show an alert on my local PC from my VB.NET app (I don't want to use the Microsoft Alerts SDK, just de MS Alert Popup window) I think this is...
3
by: lohithb | last post by:
Hi, I have used javascript onclick event handler. But, in ssl a security alert is displayed when the event is generated. So can i give me a solution for this other than the settings in the browser...
2
by: jrsjrs | last post by:
The "filetest.txt" contents is here .................. one/yes two/no three/maybe four/fun five/ok ................ The main program is here
4
by: Paul Furman | last post by:
I can't find a way to create an alert popup box for debugging, is this possible in php? I guess I'm thinking of visual basic where that was so easy, in php I normally use *print* for this but it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.