Previous Thread
Next Thread
Print Thread
Rate Thread
palmen #226186 10/10/2002 10:50 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Something like:

code:

$Username_q = addslashes($Username);
$query = "SELECT U_Phonehome,U_Phonework,U_Phonecell,U_Winch,U_Coverage,U_Calltime
FROM {$config['tbprefix']}Users
WHERE U_Username = '$Username_q'
";
$sth = $dbh -> do_query($query);
list ($HomePhone,$WorkPhone,$CellPhone,$Winch,$Coverage,$Calltime) = $dbh -> fetch_array($sth);
$dbh -> finish_sth($sth);

echo <<<UBBTPRINT

<form method="post" action="{$config['phpurl']}/addrecovery.php">
<table width="80%" border="1" cellpadding="3" cellspacing="0" align="center">
<tr>
<td>
Home Phone:
</td>
<td>
<input type="text" name="homephone" value="$HomePhone" />
</td>
</tr>
<tr>
<td>
Work Phone:
</td>
<td>
<input type="text" name="workphone" value="$WorkPhone" />
</td>
</tr>
<tr>
<td>
Cell Phone:
</td>
<td>
<input type="text" name="cellphone" value="$CellPhone" />
</td>
</tr>
<tr>
<td>
Winch:
</td>
<td>
<input type="text" name="winch" value="$Winch" />
</td>
</tr>
<tr>
<td>
Coverage:
</td>
<td>
<input type="text" name="coverage" value="$Coverage" />
</td>
</tr>
<tr>
<td>
Call Times:
</td>
<td>
<input type="text" name="calltime" value="$Calltime" />
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="submit" name="submit" value="Submit" />
</td>
</tr>
</table>
</form>

UBBTPRINT;





I think that should do it for the displaying of the info.


To add the info to the database you then create another script named addrecovery.php and make it look something like this:

code:

require ("$thispath/main.inc.php");

if ($GLOBALS['REQUEST_METHOD'] != "POST") {
exit;
}
$userob = new user;
$user = $userob -> authenticate();
$html = new html;
if (empty($user['U_Number'])) {
$html -> not_right ($ubbt_lang['NO_AUTH'],$Cat);
}

$usernumber_q = addslashes($user['U_Number']);
$homephone_q = addslashes($homephone);
$workphone_q = addslashes($workphone);
$cellphone_q = addslashes($cellphone);
$winch_q = addslahses($winch);
$coverage_q = addslashes($coverage);
$calltime_q = addslashes($calltime);

$query = "UPDATE {$config['tbprefix']}Users
SET U_Phonehome = '$homephone_q',
U_Phonework = '$workphone_q',
U_Phonecell = '$cellphone_q',
U_Winch = '$winch_q',
U_Coverage = '$coverage_q',
U_Calltime = '$calltime_q'
WHERE U_Number = '$usernumber_q'
";
$dbh -> do_query($query);


echo <<<UBBTPRINT

Recovery information has been added.

UBBTPRINT;







I know this is very basic but I think it will get you going in the right direction.


Also, I haven't tested it and since I typed it all out in this text box while posting I am not sure how well this will work by the looks of it... lol but I think it should do the trick.

Sponsored Links
Entire Thread
Subject Posted By Posted
a little help msula 10/11/2002 5:12 AM
Re: a little help JustDave 10/11/2002 5:50 AM
Re: a little help msula 10/11/2002 2:20 PM
Re: a little help msula 10/11/2002 7:22 PM
Re: a little help msula 10/11/2002 7:43 PM
Re: a little help JustDave 10/11/2002 7:47 PM
Re: a little help msula 10/11/2002 8:39 PM
Re: a little help JustDave 10/11/2002 9:19 PM
Re: a little help msula 10/11/2002 10:20 PM
Re: a little help JustDave 10/11/2002 10:30 PM
Re: a little help msula 10/13/2002 7:21 PM
Re: a little help JustDave 10/14/2002 2:31 PM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)