...

View Full Version : PHP Registration Form Output In a Chosen Place?



msredimp
03-05-2008, 08:41 PM
I have a registration script that when a username is already taken it will return to the register.php file and then echo "Username taken" etc...

Well the script returns to the register page but then the echo is just stuck to the bottom, not really a place I want it. I want it in the same box that where the register form is.

How do I go about doing this? What I am looking for is an external command I can use just before the echo so that it appears in the right place without having to make a second page with the error message already on it. Here is my script and a picture of the output:


if($login_exist > 0){
unset($login);
include 'register.php';
echo "I'm sorry but the name you specified has already been taken. Please choose another one.";
exit();
}
http://img407.imageshack.us/img407/1266/44827604pn2.jpg

Thank you very much for any help.

Fumigator
03-05-2008, 08:50 PM
You'll need to move the PHP code in your script that echos that text to where you want it to be displayed in relation to the other HTML markup that your PHP script is generating, and add the div tags and whatever else to that echo statement. Your script is creating an HTML page, after all, and every echo/print command streams the HTML markup in the order your code instructs.

msredimp
03-05-2008, 09:12 PM
Thank you :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum