hi all;
i have a reg.php where the user can register if user registration is success then he/or she is redirected to the login in 3 secs with a message saying "you have successfully registered you will be redirected to the login page shortly" but if the registration fails i have an echo saying "Registration failed you will be redirected back to the registration page shortly" the problem is that the error echo is displayed but then it redirects to the login page instead of the registration page...also after the user is redirected to the registration page after the error i want the details to remain as they were only the username field cleared...how do i do this. All suggesstions are welcome and thanks in advance

5 Years
Discussion Span
Last Post by pritaeas

and also can you giva me a user profle page code something like daniweb's EDIT PROFILE...Where the user can update his profile

Edited by pranay1995


this is my profile page code:-



$result3 = mysql_query("SELECT * FROM member where mem_id='$id'");

while($row3 = mysql_fetch_array($result3))







<table width="398" border="0" align="center" cellpadding="0">

    <td height="26" colspan="2">Your Profile Information </td>

    <td><div align="right"><a href="index.php">logout</a></div></td>

    <td width="129" rowspan="5"><img src="<?php echo $picture ?>" width="129" height="129" alt="no image found"/></td>

    <td width="82" valign="top"><div align="left">FirstName:</div></td>
    <td width="165" valign="top"><?php echo $fname ?></td>

    <td valign="top"><div align="left">LastName:</div></td>

    <td valign="top"><?php echo $lname ?></td>

    <td valign="top"><div align="left">Gender:</div></td>

    <td valign="top"><?php echo $gender ?></td>

    <td valign="top"><div align="left">Address:</div></td>

    <td valign="top"><?php echo $address ?></td>

    <td valign="top"><div align="left">Contact No.: </div></td>

    <td valign="top"><?php echo $contact ?></td>

<p align="center"><a href="index.php"></a></p>`

neither can the user view nor edit the profile


i dont know doesnt display error nor details i have being struggling and my deadlines next week please help with the profile part.


Does it display anything at all? What if you "view source" in the browser?

Edited by pritaeas


Check your error log. From your code the only explanation for no output at all would be an error in connection.php.


@pritaeas this is the redirect issue plea help the reg.php

$Password = md5($_POST["Password"]);

mysql_select_db($database) or die("There was an error connecting you to our server");

$pass="INSERT INTO registration (Name,Age,Mobilenumber,Address,Username,Password)VALUES('$Name','$Age','$Mobilenumber','$Address','$Username','$Password')";

if (mysql_query($pass))
echo 'You have succesfully Registered: you will be redirected back to the home page where you can login if you want in a few seconds'; 

echo 'username already taken';

header('refresh: 3; url=index.php');

Edited by pritaeas: Fixed code tags


I do not see any errors in this. But what does this code have to do with your previous question? This script will always redirect to index.php

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.