Имам проблем.Опитвам се да направя да има в едитпрофил такова за скайп,АйСиКю,Сайт, но нещо не се запаметява..Какъв е проблема.Ето кода за editprofile.php
А ето кода за members.php
Как да го оправя?
Код:
<?
ob_start();
include("config.php");
if ($logged[username])
{
// the user is logged in! We continue...
if (!$_POST[update])
{
// the form hasn't been submitted. We continue...
$profile = mysql_query("SELECT * from register where username = '$logged[username]'");
$profile = mysql_fetch_array($profile);
// the above lines get the information so that it can be displayed in the html form.
echo("
<center><form method=\"POST\">
<table width=\"100%\">
<tr>
<td align=\"right\" width=\"25%\">
Location
</td>
<td align=\"left\">
<input type=\"text\" size=\"25\" maxlength=\"25\" name=\"locate\" value=\"$profile[location]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
MSN Messenger
</td>
<td align=\"left\">
<input size=\"25\" name=\"msn\" value=\"$profile[msn]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
AOL Messenger</td>
<td align=\"left\">
<input size=\"25\" name=\"aim\" value=\"$profile[aim]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
Email адрес</td>
<td align=\"left\">
<input size=\"25\" name=\"email\" value=\"$profile[email]\"></td>
</tr>
<td align=\"right\" width=\"25%\">
Skype:</td>
<td align=\"left\">
<input size=\"25\" name=\"skype\" value=\"$profile[skype]\"></td>
</tr>
<td align=\"right\" width=\"25%\">
ICQ:</td>
<td align=\"left\">
<input size=\"25\" name=\"ICQ\" value=\"$profile[ICQ]\"></td>
</tr>
<td align=\"right\" width=\"25%\">
WEB-PAGE</td>
<td align=\"left\">
<input size=\"25\" name=\"webpage\" value=\"$profile[Webpage]\"></td>
</tr>
<tr>
<td align=\"center\">
</td>
<td align=\"left\">
<input type=\"submit\" name=\"update\" value=\"Обнови\"></td>
</tr>
</table>
</form>
</center>");
}
else
{
$email = htmlspecialchars($_POST[email]);
$aim = htmlspecialchars($_POST[aim]);
$msn = htmlspecialchars($_POST[msn]);
$skype = htmlspecialchars($_POST[skype]);
$icq = htmlspecialchars($_POST[icq]);
$webpage = htmlspecialchars($_POST[Webpage]);
$locate = htmlspecialchars($_POST[locate]);
// the above lines get rid of all html.
echo ("Вашия профил е успешно обновен.");
$update = mysql_query("Update register set email = '$email',
msn = '$msn', aim = '$aim', skype= '$skype', icq= '$icq', webpage= '$webpage', location = '$locate' where username = '$logged[username]'");
// updates the information in the database.
}
}
else
{
// They aren't logged in!
echo ("<a href=\"login.php\">Не сте логнат</a>");
}
?>
А ето кода за members.php
Код:
<?
ob_start();
include("config.php");
if (!$_GET[user])
{
$getuser = mysql_query("SELECT * from register order by id asc");
while ($user = mysql_fetch_array($getuser))
{
// gets all the users information.
echo ("<a href=\"members.php?user=$user[username]\">$user[username]</a><br />\n");
// links to a page to view the user's profile.
}
}
ELSE
{
$getuser = mysql_query("SELECT * from register where username = '$_GET[user]'");
$usernum = mysql_num_rows($getuser);
if ($usernum == 0)
{
echo ("Няма потребители");
}
else
{
$profile = mysql_fetch_array($getuser);
echo ("<center><b>Профила на: $profile[username]</b><br /></center>
MSN Messenger: $profile[msn]<br />
AIM Messebger: $profile[aim]<br />
Location: $profile[location]<br />
Skype: $profile[skype]<br />
ICQ: $profile[ICQ]<br />
WEB-PAGE: $profile[webpage]<br />
Email адрес: $profile[email]");
// in the above code, we display the user's information.
}
}
?>
Как да го оправя?