Jump to content
php.lv forumi

Input logs...


xmas12

Recommended Posts

Sveiki. esmu sev uztasisijis profile lapu kur var editēd profilu.. Es uztasiiju echo lai ja lietotajs nav ielogojeis tad nevar labot profilu bet jaielogojeis tad var labot profilu, un es gribu lai katru reizi nav jaaraksta katrs lauks tad gribu lai man katraa laikaa izvlk no datubaazes fieldu. es rakstu šādi <?php echo $niks; ?> bet man neizvelk un input logaa vnk izmet sito kodu un vis. mby kads var palidzet?

Link to comment
Share on other sites

Ko tev tur īsti izmet ārā?

Tev tas niks lai ievadītu input laukā ir jāizvada caur value.

<input type="text" name="niks" value="<?=$niks;?>">

man nejiet, bet man vis profile html kods staav iekšā echo. un nejiet, kaa iznemu no echo taa uzreiz aiziet. Bet es gribu lai man rada vai tu esi ielogojies vai nesi, un ja nesi ielogojies tad paradaas teksts Jūs nēsat ielogojies.. Reku ir man kods :

 

<?php

if(isset($_COOKIE['member_id'])){
$get=mysql_query("SELECT * FROM `ibf_members` WHERE id='".intval($_COOKIE['member_id'])."'") or die(mysql_error());
$id = $_COOKIE['member_id'];
$dati= "SELECT * FROM `ibf_members` WHERE id = $id LIMIT 1";
$dati1=mysql_query($dati) or mysql_error();
$dati2= mysql_fetch_array($dati1);
$avatar= "SELECT * FROM `ibf_member_extra` WHERE id = $id LIMIT 1";
$avatar1=mysql_query($avatar) or mysql_error();
$avatar2= mysql_fetch_array($avatar1);
$udata=mysql_fetch_object($get);
if($udata->member_login_key==$_COOKIE['pass_hash']) {

echo '
<b>Profila bilde:</b>
<form method="post" action="">
<table>
<tr><td>Bildes adrese:</td><td><input type="text" name="avatar_location" style="width:350px;" /></td></tr>
<br />
<tr><td><input type="submit" value="Mainīt bildi" name="labot3" /></td></tr>
</table>
</form>
<br />
<br />


<b>Tava infomacija:</b>
<form method="post" action="">
<table>
<tr><td>Vārds:</td><td><input type="text" name="name" value="<?=$name;?>"></td></tr>
<tr><td>Uzvārds:</td><td><input type="text" name="uzvards" value="<?php echo $uzvards;?>" /></td></tr>
<tr><td>Epasts:</td><td><input type="text" name="email" value="<?php echo $email;?>" /></td></tr>
<tr><td>Skype:</td><td><input type="text" name="skype" value="<?php echo $skype;?>" /></td></tr>
<tr><td>Dzīvesvieta:</td><td><input type="text" name="dzivesvieta" value="<?php echo $dzivesvieta;?>" /></td></tr>
<br />
<tr><td><input type="submit" value="Labot Informaciju" name="labot" /></td></tr>
</table>
</form>
<br />
<br />

<b>Tavs Dators:</b>
<form method="post" action="">
<table>
<tr><td>Procis:</td><td><input type="text" name="procis" /></td></tr>
<tr><td>Pele:</td><td><input type="text" name="pele" /></td></tr>
<tr><td>Klavjatūra:</td><td><input type="text" name="klava" /></td></tr>
<tr><td>Cietais disks:</td><td><input type="text" name="cietais" /></td></tr>
<tr><td>Austiņas:</td><td><input type="text" name="austinas" /></td></tr>
<tr><td>Video karte:</td><td><input type="text" name="vkarte" /></td></tr>
<tr><td>Rams:</td><td><input type="text" name="rams" /></td></tr>
<tr><td>Monitors:</td><td><input type="text" name="monitors" /></td></tr>
<br />
<tr><td><input type="submit" value="Labot Informāciju" name="labot2" /></td></tr>
</table>
</form>

<br />
<br />

<b>Tava parole:</b>
<form method="post" action="">
<table>
<tr><td>Veca parole:</td><td><input type="password" name="current_password" /></td></tr>
<tr><td>Jaunā parole:</td><td><input type="password" name="new_password" /></td></tr>
<tr><td>Jaunā parole velreiz:</td><td><input type="password" name="new_password_control" /></td></tr>
<tr><td></td><td><input type="submit" value="Labot paroli" /></td></tr>
</table>
</form>


';


}else{

echo '
<b>Jūs nēsat ielogojies lai labotu profilu!!!</b>';

}

}else{

echo '

<b>Jūs nēsat ielogojies lai labotu profilu!!!</b>';



}

?></center>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...