can anyone help me, i've developed a secure login, admin panel, and user cp, but I want the user to be able to update their details when logged in, i've done a page where the user can update using a form if logged in and i've created the processing page, but i need php to add the form variables $email, and $website into a some html stored in a variable to be added to the database. The code has a problem on linea 7 and 8, the $emailcode and $websitecode lines, can you help me with how to add the php variables into the html code ?
here is the code:
userupdateprocess.php
===============
<?php
session_start();
$email = $_POST['email'];
$location = $_POST['location'];
$website = $_POST['website'];
$emailcode = print"<a href="mailto:"'.$email.'">"'.$email.'"</a>";
$websitecode = print"<a href="'.$website.'">"'.$website.'"</a>";
include("config.php"); //include config file
mysql_connect ($dbhost, $dbuser, $dbpass) or die ('My SQL Error: ' . mysql_error());
mysql_select_db ($dbname);
$query = "INSERT INTO users (email, location, website) VALUES ('$emailcode', '$location', '$websitecode') WHERE username='".$_SESSION['username]'."' AND password='".$_SESSION['password']."'");
mysql_query($query) or die ('update failed, please try again...');
echo("update successfull...");
?>
updateuser.php (php code only)
====================
<?php
session_start();?>
if(isset($_SESSION['username']) && isset($_SESSION['password'])){
print "Welcome to your personal control panel, ";
echo "<br>";
print $_SESSION['username'];
?> : <a href="logout.php">logout</a>
<form name="updateuser" action="userupdateprocess.php" method="post">
<font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="ff6600">
+</font><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="ffa200">email:</font>
<input name="email" type="text">
<font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="ff6600">+</font><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="ffa200">location:</font>
<input name="location" type="text"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="ff6600">
+</font><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="ffa200">website:</font>
<input name="website" type="text"><br><input name="submit" type="submit" id="submit" value="update"></form>
<?
}else{
print "<center>";
print "Welcome, you are not logged in,";
print "<br>";
print "please login below";
print "<br>";
print "to access personal control panel:";
print "</center>";
print "<br>";
include ("loginform.php");
?>
</font><font color="FFA200" size="1" face="Verdana, Arial, Helvetica, sans-serif"><?
}
?>
any ideas on how to fix the code:
$emailcode = print"<a href="mailto:"'.$email.'">"'.$email.'"</a>";
$websitecode = print"<a href="'.$website.'">"'.$website.'"</a>";
would be really appreciated....
thanks, chronic_