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

okay i will show you as soon as i get home is that okay

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

can you giva me

No. We will help you if you show some effort, but we will not provide ready code.

i have tried a recordset but it fails

this is my profile page code:-
`

<?php
require_once('connection.php');

$id=$_SESSION['SESS_MEMBER_ID'];

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

while($row3 = mysql_fetch_array($result3))

{ 
$fname=$row3['fname'];

$lname=$row3['lname'];

$address=$row3['address'];

$contact=$row3['contact'];

$picture=$row3['picture'];

$gender=$row3['gender'];

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

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

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

  <tr>
    <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>

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

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

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

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

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

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

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

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

  </tr>
</table>
<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?

nope no output

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

okay let me try

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

<?php
$username="root";
$password="";
$host="localhost";
$database="spl";
mysql_connect($host,$username,$password);
$Name=$_POST['Name'];
$Age=$_POST['Age'];
$Mobilenumber=$_POST['Mobilenumber'];
$Address=$_POST['Address'];
$Username=$_POST['Username'];
$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'; 

else
echo 'username already taken';

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.