Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

Have you purchased a mod and lost your copy? Just file a support ticket through your "My Mods" page.


This forum is now closed and has moved to a new location! Click here to find out why.

AuthorTopic: Cant Get This To Work..  (Read 1105 times)

Dusty

  • Basic Member
  • *
  • Reputation Power: 21
  • Dusty has no influence.
  • Offline Offline
  • Posts: 39
  • TRD Computer Repair
    • Yahoo Instant Messenger - peewee986
    • View Profile
    • WWW
Cant Get This To Work..
« on: October 03, 2009, 11:55:36 AM »
Im getting this error
Parse error: syntax error, unexpected T_VARIABLE in /home/glocktal/public_html/profile.php on line 20



Code: [Select]
<?php
include(DIRNAME(__FILE__) . '/globals.php');
global 
$ir,$db,$h;
if(isset(
$_POST['firstname']) || isset($_POST['lastname']))
{
$_POST['firstname'] = nl2br(stripslashes(htmlspecialchars($_POST['firstname'])));
$_POST['lastname'] = nl2br(stripslashes(htmlspecialchars($_POST['lastname'])));
$_POST['realcity'] = nl2br(stripslashes(htmlspecialchars($_POST['realcity'])));
$_POST['country'] = nl2br(stripslashes(htmlspecialchars($_POST['country'])));
$_POST['state'] = nl2br(stripslashes(htmlspecialchars($_POST['state'])));
$_POST['zipcode'] = nl2br(stripslashes(htmlspecialchars($_POST['zipcode'])));
$_POST['status'] = nl2br(stripslashes(htmlspecialchars($_POST['status'])));
$_POST['hometown'] = nl2br(stripslashes(htmlspecialchars($_POST['hometown'])));
$_POST['zodiac'] = nl2br(stripslashes(htmlspecialchars($_POST['zodiac'])));
$_POST['occup'] = nl2br(stripslashes(htmlspecialchars($_POST['occup'])));
$_POST['headline'] = nl2br(stripslashes(htmlspecialchars($_POST['headline'])));
$_POST['header'] = nl2br(stripslashes(htmlspecialchars($_POST['header'])));
$_POST['about_me'] = nl2br(stripslashes(htmlspecialchars($_POST['about_me'])));

$update = ('UPDATE users SET firstname=%s, lastname=%s, age=%u, city=%s, country=%s, state=%s, zipcode=%s, status=%s, hometown=%s, zodiac=%s, orientation=%s, hometown=%s, occupation=%s, headline=%s, header=%s, About_Me=%s, display_pic=%s WHERE (userid = %u)' $_POST['firstname'], $_POST['lastname'], $_POST['realage'], $_POST['realcity'], $_POST['country'], $_POST['state'], $_POST['zipcode'], $_POST['status'], $_POST['hometown'], $_POST['zodiac'], $_POST['Orientation'], $_POST['hometown'], $_POST['occup'], $_POST['headline'], $_POST['header'], $_POST['about_me'], $_POST['newpic'], abs(@int($userid);
$db->query($update);
}
else{
?>

<form>
<h2>Profile Information</h2><br />
<b>First name:
<input type="text" name="firstname" />
<br />
Last name:
<input type="text" name="lastname" />
<br />
Age:
<input type="text" name="realage" />
<br />
<input type="radio" name="gender" value="male" /> Male
<br />
<input type="radio" name="gender" value="female" /> Female<br />
<br />
<br />
<h3>Location</h3><br />
City:
<input type="text" name="realcity" />
<br />
Country:
<input type="text" name="country" />
<br />
State:
<input type="text" name="state" />
<br />
Zip Code:
<input type="text" name="zipcode" />
<br />
<br />
<h3>Details:</h3><br />
Marital Status:
<input type="text" name="status" />
<br />
Orientation:
<SELECT name="Orientation">
<OPTION SELECTED>--Choose--
<OPTION>BI
<OPTION>Gay/Lesbian
<OPTION>Straight
<OPTION>Not Sure
<OPTION>No Answer
</SELECT>
<br />
Hometown:
<input type="text" name="hometown" />
<br />
Zodiac Sign:
<input type="text" name="zodiac" />
<br />
Occupation:
<input type="text" name="occup" />
<br />
Headline:
<input type="text" name="headline" />
<br />
<br />
<h3>Change Profile Pictures:</h3><br />
Header:
<input type="text" name="header"  />
<br />
Profile Pic:
<input type="text" name="newpic" value="{$ir['display_pic']}" />
<br />
<br />
<h3>About Me:</h3><br />
<form action= method='post'>
<input type='hidden' name='submit' value='1' />
<TEXTAREA NAME="about_me" COLS=40 ROWS=6></TEXTAREA>
<P><INPUT TYPE=SUBMIT VALUE="submit">
</form><br />
<?php}
$h->endpage();
?>

Edit: [ code ] tags - Spudinski
« Last Edit: October 12, 2009, 06:48:31 AM by Spudinski »
Logged
TRD Computer Repair Services
www.trdcomputer.com

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Cant Get This To Work..
« Reply #1 on: October 03, 2009, 03:58:54 PM »
Please use code tags, and your welcome ;) haha
Logged
Project Choosen - 10%
Daniel - Hanson . Com

Dusty

  • Basic Member
  • *
  • Reputation Power: 21
  • Dusty has no influence.
  • Offline Offline
  • Posts: 39
  • TRD Computer Repair
    • Yahoo Instant Messenger - peewee986
    • View Profile
    • WWW
Re: Cant Get This To Work..
« Reply #2 on: October 03, 2009, 05:47:16 PM »
Yea thanks much.

but the error that im getting.   whats it from .. Im not sure i know what you are talking about ..   with code tags.   
Logged
TRD Computer Repair Services
www.trdcomputer.com

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Cant Get This To Work..
« Reply #3 on: October 04, 2009, 05:27:41 AM »
use [code222] and[/code222] without the 222's
Logged
Project Choosen - 10%
Daniel - Hanson . Com

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Cant Get This To Work..
« Reply #4 on: October 04, 2009, 08:51:12 AM »
Try

$update sprintf('UPDATE users SET firstname=%s, lastname=%s, age=%u, city=%s, country=%s, state=%s, zipcode=%s, status=%s, hometown=%s, zodiac=%s, orientation=%s, hometown=%s, occupation=%s, headline=%s, header=%s, About_Me=%s, display_pic=%s WHERE (userid = %u)' $_POST['firstname'], $_POST['lastname'], $_POST['realage'], $_POST['realcity'], $_POST['country'], $_POST['state'], $_POST['zipcode'], $_POST['status'], $_POST['hometown'], $_POST['zodiac'], $_POST['Orientation'], $_POST['hometown'], $_POST['occup'], $_POST['headline'], $_POST['header'], $_POST['about_me'], $_POST['newpic'], abs(@int($userid);

I forgot the sprintf
Logged
Project Choosen - 10%
Daniel - Hanson . Com

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Cant Get This To Work..
« Reply #5 on: October 04, 2009, 08:51:39 AM »
i think i broke it
Logged
Project Choosen - 10%
Daniel - Hanson . Com

Dusty

  • Basic Member
  • *
  • Reputation Power: 21
  • Dusty has no influence.
  • Offline Offline
  • Posts: 39
  • TRD Computer Repair
    • Yahoo Instant Messenger - peewee986
    • View Profile
    • WWW
Re: Cant Get This To Work..
« Reply #6 on: October 04, 2009, 09:38:32 PM »
LMAO .. broke what .. LMAO ..
Logged
TRD Computer Repair Services
www.trdcomputer.com

Dusty

  • Basic Member
  • *
  • Reputation Power: 21
  • Dusty has no influence.
  • Offline Offline
  • Posts: 39
  • TRD Computer Repair
    • Yahoo Instant Messenger - peewee986
    • View Profile
    • WWW
Re: Cant Get This To Work..
« Reply #7 on: October 04, 2009, 09:47:19 PM »
Still getting the same Error .. I changed the old part to the new part and im still getting the same error ..   Here is the Code with the new added part you gave me.  and here is the error message again..   

Parse error: syntax error, unexpected T_VARIABLE in /home/glocktal/public_html/123.php on line 20

Code: [Select]
<?php
include(DIRNAME(__FILE__) . '/globals.php');
global 
$ir,$db,$h;
if(isset(
$_POST['firstname']) || isset($_POST['lastname']))
{
$_POST['firstname'] = nl2br(stripslashes(htmlspecialchars($_POST['firstname'])));
$_POST['lastname'] = nl2br(stripslashes(htmlspecialchars($_POST['lastname'])));
$_POST['realcity'] = nl2br(stripslashes(htmlspecialchars($_POST['realcity'])));
$_POST['country'] = nl2br(stripslashes(htmlspecialchars($_POST['country'])));
$_POST['state'] = nl2br(stripslashes(htmlspecialchars($_POST['state'])));
$_POST['zipcode'] = nl2br(stripslashes(htmlspecialchars($_POST['zipcode'])));
$_POST['status'] = nl2br(stripslashes(htmlspecialchars($_POST['status'])));
$_POST['hometown'] = nl2br(stripslashes(htmlspecialchars($_POST['hometown'])));
$_POST['zodiac'] = nl2br(stripslashes(htmlspecialchars($_POST['zodiac'])));
$_POST['occup'] = nl2br(stripslashes(htmlspecialchars($_POST['occup'])));
$_POST['headline'] = nl2br(stripslashes(htmlspecialchars($_POST['headline'])));
$_POST['header'] = nl2br(stripslashes(htmlspecialchars($_POST['header'])));
$_POST['about_me'] = nl2br(stripslashes(htmlspecialchars($_POST['about_me'])));

$update sprintf('UPDATE users SET firstname=%s, lastname=%s, age=%u, city=%s, country=%s, state=%s, zipcode=%s, status=%s, hometown=%s, zodiac=%s, orientation=%s, hometown=%s, occupation=%s, headline=%s, header=%s, About_Me=%s, display_pic=%s WHERE (userid = %u)' $_POST['firstname'], $_POST['lastname'], $_POST['realage'], $_POST['realcity'], $_POST['country'], $_POST['state'], $_POST['zipcode'], $_POST['status'], $_POST['hometown'], $_POST['zodiac'], $_POST['Orientation'], $_POST['hometown'], $_POST['occup'], $_POST['headline'], $_POST['header'], $_POST['about_me'], $_POST['newpic'], abs(@int($userid);
$db->query($update);
}
else{
?>

<form>
<h2>Profile Information</h2><br />
<b>First name:
<input type="text" name="firstname" />
<br />
Last name:
<input type="text" name="lastname" />
<br />
Age:
<input type="text" name="realage" />
<br />
<input type="radio" name="gender" value="male" /> Male
<br />
<input type="radio" name="gender" value="female" /> Female<br />
<br />
<br />
<h3>Location</h3><br />
City:
<input type="text" name="realcity" />
<br />
Country:
<input type="text" name="country" />
<br />
State:
<input type="text" name="state" />
<br />
Zip Code:
<input type="text" name="zipcode" />
<br />
<br />
<h3>Details:</h3><br />
Marital Status:
<input type="text" name="status" />
<br />
Orientation:
<SELECT name="Orientation">
<OPTION SELECTED>--Choose--
<OPTION>BI
<OPTION>Gay/Lesbian
<OPTION>Straight
<OPTION>Not Sure
<OPTION>No Answer
</SELECT>
<br />
Hometown:
<input type="text" name="hometown" />
<br />
Zodiac Sign:
<input type="text" name="zodiac" />
<br />
Occupation:
<input type="text" name="occup" />
<br />
Headline:
<input type="text" name="headline" />
<br />
<br />
<h3>Change Profile Pictures:</h3><br />
Header:
<input type="text" name="header"  />
<br />
Profile Pic:
<input type="text" name="newpic" value="{$ir['display_pic']}" />
<br />
<br />
<h3>About Me:</h3><br />
<form action= method='post'>
<input type='hidden' name='submit' value='1' />
<TEXTAREA NAME="about_me" COLS=40 ROWS=6></TEXTAREA>
<P><INPUT TYPE=SUBMIT VALUE="submit">
</form><br />
<?php}
$h->endpage();
?>

Logged
TRD Computer Repair Services
www.trdcomputer.com

Dusty

  • Basic Member
  • *
  • Reputation Power: 21
  • Dusty has no influence.
  • Offline Offline
  • Posts: 39
  • TRD Computer Repair
    • Yahoo Instant Messenger - peewee986
    • View Profile
    • WWW
Re: Cant Get This To Work..
« Reply #8 on: October 07, 2009, 11:17:10 AM »
bump
Logged
TRD Computer Repair Services
www.trdcomputer.com

Spudinski

  • Basic Member
  • *
  • Reputation Power: 42
  • Spudinski has no influence.
  • Offline Offline
  • Posts: 53
  • I have cookies!
    • View Profile
    • WWW
    • Email
Re: Cant Get This To Work..
« Reply #9 on: October 07, 2009, 12:23:53 PM »
Hey, as I see it you just have a simple syntax error; you need a few brackets on line 19.
Here is the modified script, try it and let me know if it works now.
Code: [Select]
<?php
include(DIRNAME(__FILE__) . '/globals.php');
global 
$ir,$db,$h;
if(isset(
$_POST['firstname']) || isset($_POST['lastname']))
{
$_POST['firstname'] = nl2br(stripslashes(htmlspecialchars($_POST['firstname'])));
$_POST['lastname'] = nl2br(stripslashes(htmlspecialchars($_POST['lastname'])));
$_POST['realcity'] = nl2br(stripslashes(htmlspecialchars($_POST['realcity'])));
$_POST['country'] = nl2br(stripslashes(htmlspecialchars($_POST['country'])));
$_POST['state'] = nl2br(stripslashes(htmlspecialchars($_POST['state'])));
$_POST['zipcode'] = nl2br(stripslashes(htmlspecialchars($_POST['zipcode'])));
$_POST['status'] = nl2br(stripslashes(htmlspecialchars($_POST['status'])));
$_POST['hometown'] = nl2br(stripslashes(htmlspecialchars($_POST['hometown'])));
$_POST['zodiac'] = nl2br(stripslashes(htmlspecialchars($_POST['zodiac'])));
$_POST['occup'] = nl2br(stripslashes(htmlspecialchars($_POST['occup'])));
$_POST['headline'] = nl2br(stripslashes(htmlspecialchars($_POST['headline'])));
$_POST['header'] = nl2br(stripslashes(htmlspecialchars($_POST['header'])));
$_POST['about_me'] = nl2br(stripslashes(htmlspecialchars($_POST['about_me'])));

$update sprintf('UPDATE users SET firstname=%s, lastname=%s, age=%u, city=%s, country=%s, state=%s, zipcode=%s, status=%s, hometown=%s, zodiac=%s, orientation=%s, hometown=%s, occupation=%s, headline=%s, header=%s, About_Me=%s, display_pic=%s WHERE (userid = %u)' $_POST['firstname'], $_POST['lastname'], $_POST['realage'], $_POST['realcity'], $_POST['country'], $_POST['state'], $_POST['zipcode'], $_POST['status'], $_POST['hometown'], $_POST['zodiac'], $_POST['Orientation'], $_POST['hometown'], $_POST['occup'], $_POST['headline'], $_POST['header'], $_POST['about_me'], $_POST['newpic'], abs(@int($userid)));
$db->query($update);
}
else{
?>

<form>
<h2>Profile Information</h2><br />
<b>First name:
<input type="text" name="firstname" />
<br />
Last name:
<input type="text" name="lastname" />
<br />
Age:
<input type="text" name="realage" />
<br />
<input type="radio" name="gender" value="male" /> Male
<br />
<input type="radio" name="gender" value="female" /> Female<br />
<br />
<br />
<h3>Location</h3><br />
City:
<input type="text" name="realcity" />
<br />
Country:
<input type="text" name="country" />
<br />
State:
<input type="text" name="state" />
<br />
Zip Code:
<input type="text" name="zipcode" />
<br />
<br />
<h3>Details:</h3><br />
Marital Status:
<input type="text" name="status" />
<br />
Orientation:
<SELECT name="Orientation">
<OPTION SELECTED>--Choose--
<OPTION>BI
<OPTION>Gay/Lesbian
<OPTION>Straight
<OPTION>Not Sure
<OPTION>No Answer
</SELECT>
<br />
Hometown:
<input type="text" name="hometown" />
<br />
Zodiac Sign:
<input type="text" name="zodiac" />
<br />
Occupation:
<input type="text" name="occup" />
<br />
Headline:
<input type="text" name="headline" />
<br />
<br />
<h3>Change Profile Pictures:</h3><br />
Header:
<input type="text" name="header"  />
<br />
Profile Pic:
<input type="text" name="newpic" value="{$ir['display_pic']}" />
<br />
<br />
<h3>About Me:</h3><br />
<form action= method='post'>
<input type='hidden' name='submit' value='1' />
<TEXTAREA NAME="about_me" COLS=40 ROWS=6></TEXTAREA>
<P><INPUT TYPE=SUBMIT VALUE="submit">
</form><br />
<?php}
$h->endpage();
?>
Logged
If you see a post that just doesn't just seem right, send me a PM.
Offering services for small-type games and websites, send me a PM if you want/need something done.

Dusty

  • Basic Member
  • *
  • Reputation Power: 21
  • Dusty has no influence.
  • Offline Offline
  • Posts: 39
  • TRD Computer Repair
    • Yahoo Instant Messenger - peewee986
    • View Profile
    • WWW
Re: Cant Get This To Work..
« Reply #10 on: October 07, 2009, 01:12:02 PM »
Thanks but did not work ..   using the code that you posted about ^^^^   Im getting this error  "same error as before"
Parse error: syntax error, unexpected T_VARIABLE in /home/glocktal/public_html/123.php on line 20

may be some thing between line 1 and line 20 ..   I know Html  but when you get into php and mysql   Im lost..
Logged
TRD Computer Repair Services
www.trdcomputer.com

Spudinski

  • Basic Member
  • *
  • Reputation Power: 42
  • Spudinski has no influence.
  • Offline Offline
  • Posts: 53
  • I have cookies!
    • View Profile
    • WWW
    • Email
Re: Cant Get This To Work..
« Reply #11 on: October 08, 2009, 06:33:22 AM »
Thanks but did not work ..   using the code that you posted about ^^^^   Im getting this error  "same error as before"
Parse error: syntax error, unexpected T_VARIABLE in /home/glocktal/public_html/123.php on line 20

may be some thing between line 1 and line 20 ..   I know Html  but when you get into php and mysql   Im lost..

Oh, yea... sorry, I didn't read the whole line.
Try this version, the line is fixed as I see it.
Although I don't personally use the sprintf function(personal reasons), I think it's fixed as of now.
Code: [Select]
<?php
include(DIRNAME(__FILE__) . '/globals.php');
global 
$ir,$db,$h;
if(isset(
$_POST['firstname']) || isset($_POST['lastname']))
{
$_POST['firstname'] = nl2br(stripslashes(htmlspecialchars($_POST['firstname'])));
$_POST['lastname'] = nl2br(stripslashes(htmlspecialchars($_POST['lastname'])));
$_POST['realcity'] = nl2br(stripslashes(htmlspecialchars($_POST['realcity'])));
$_POST['country'] = nl2br(stripslashes(htmlspecialchars($_POST['country'])));
$_POST['state'] = nl2br(stripslashes(htmlspecialchars($_POST['state'])));
$_POST['zipcode'] = nl2br(stripslashes(htmlspecialchars($_POST['zipcode'])));
$_POST['status'] = nl2br(stripslashes(htmlspecialchars($_POST['status'])));
$_POST['hometown'] = nl2br(stripslashes(htmlspecialchars($_POST['hometown'])));
$_POST['zodiac'] = nl2br(stripslashes(htmlspecialchars($_POST['zodiac'])));
$_POST['occup'] = nl2br(stripslashes(htmlspecialchars($_POST['occup'])));
$_POST['headline'] = nl2br(stripslashes(htmlspecialchars($_POST['headline'])));
$_POST['header'] = nl2br(stripslashes(htmlspecialchars($_POST['header'])));
$_POST['about_me'] = nl2br(stripslashes(htmlspecialchars($_POST['about_me'])));

$update sprintf('UPDATE users SET firstname=%s, lastname=%s, age=%u, city=%s, country=%s, state=%s, zipcode=%s, status=%s, hometown=%s, zodiac=%s, orientation=%s, hometown=%s, occupation=%s, headline=%s, header=%s, About_Me=%s, display_pic=%s WHERE (userid = %u)'$_POST['firstname'], $_POST['lastname'], $_POST['realage'], $_POST['realcity'], $_POST['country'], $_POST['state'], $_POST['zipcode'], $_POST['status'], $_POST['hometown'], $_POST['zodiac'], $_POST['Orientation'], $_POST['hometown'], $_POST['occup'], $_POST['headline'], $_POST['header'], $_POST['about_me'], $_POST['newpic'], abs(@int($userid)));
$db->query($update);
}
else{
?>

<form>
<h2>Profile Information</h2><br />
<b>First name:
<input type="text" name="firstname" />
<br />
Last name:
<input type="text" name="lastname" />
<br />
Age:
<input type="text" name="realage" />
<br />
<input type="radio" name="gender" value="male" /> Male
<br />
<input type="radio" name="gender" value="female" /> Female<br />
<br />
<br />
<h3>Location</h3><br />
City:
<input type="text" name="realcity" />
<br />
Country:
<input type="text" name="country" />
<br />
State:
<input type="text" name="state" />
<br />
Zip Code:
<input type="text" name="zipcode" />
<br />
<br />
<h3>Details:</h3><br />
Marital Status:
<input type="text" name="status" />
<br />
Orientation:
<SELECT name="Orientation">
<OPTION SELECTED>--Choose--
<OPTION>BI
<OPTION>Gay/Lesbian
<OPTION>Straight
<OPTION>Not Sure
<OPTION>No Answer
</SELECT>
<br />
Hometown:
<input type="text" name="hometown" />
<br />
Zodiac Sign:
<input type="text" name="zodiac" />
<br />
Occupation:
<input type="text" name="occup" />
<br />
Headline:
<input type="text" name="headline" />
<br />
<br />
<h3>Change Profile Pictures:</h3><br />
Header:
<input type="text" name="header"  />
<br />
Profile Pic:
<input type="text" name="newpic" value="{$ir['display_pic']}" />
<br />
<br />
<h3>About Me:</h3><br />
<form action= method='post'>
<input type='hidden' name='submit' value='1' />
<TEXTAREA NAME="about_me" COLS=40 ROWS=6></TEXTAREA>
<P><INPUT TYPE=SUBMIT VALUE="submit">
</form><br />
<?php}
$h->endpage();
?>
Logged
If you see a post that just doesn't just seem right, send me a PM.
Offering services for small-type games and websites, send me a PM if you want/need something done.

Dusty

  • Basic Member
  • *
  • Reputation Power: 21
  • Dusty has no influence.
  • Offline Offline
  • Posts: 39
  • TRD Computer Repair
    • Yahoo Instant Messenger - peewee986
    • View Profile
    • WWW
Re: Cant Get This To Work..
« Reply #12 on: October 11, 2009, 11:19:20 PM »
Sorry i was out sick for a while..   So i just tried it and it comes up ..  Then only thing is   Its not posting the information to my database on the tables.     can some one may be right a sql code for the page code above this ..   I added the thing in the user table for that info on this page .. and i have it where it will show on the viewuser .. but  this code will not update it .. or show the info that is already in the DB..    BUT   it is coming up and im not getting a error ..   Thanks for your help getting the code to show.. 
Logged
TRD Computer Repair Services
www.trdcomputer.com

Spudinski

  • Basic Member
  • *
  • Reputation Power: 42
  • Spudinski has no influence.
  • Offline Offline
  • Posts: 53
  • I have cookies!
    • View Profile
    • WWW
    • Email
Re: Cant Get This To Work..
« Reply #13 on: October 12, 2009, 06:47:07 AM »
I fiddled around with your script for a bit, allot in there is actually incorrect.
I added some formatting to it, changed the main sql query - to my style -, and added what you missed.

It should work as intended if your database is in proper structure.
Code: [Select]
<?php

  
require_once('./globals.php');
  
  if (!empty(
$_POST)) {
      
$firstname htmlspecialchars($_POST['firstname']);
      
$lastname htmlspecialchars($_POST['lastname']);
      
$realcity htmlspecialchars($_POST['realcity']);
      
$country htmlspecialchars($_POST['country']);
      
$state htmlspecialchars($_POST['state']);
      
$zipcode htmlspecialchars($_POST['zipcode']);
      
$status htmlspecialchars($_POST['status']);
      
$hometown htmlspecialchars($_POST['hometown']);
      
$zodiac htmlspecialchars($_POST['zodiac']);
      
$occup htmlspecialchars($_POST['occup']);
      
$headline htmlspecialchars($_POST['headline']);
      
$header htmlspecialchars($_POST['header']);
      
$about_me nl2br(htmlspecialchars($_POST['about_me']));
      
      
$sid intval($userid);
      
$newpic htmlspecialchars($_POST['newpic']);
      
$orientation htmlspecialchars($_POST['orientation']);
      
      
$update "UPDATE `users` 
      SET 
       `firstname` = '$firstname', 
       `lastname` = '$lastname', 
       `age` = $realage, 
    `city` = '$realcity', 
`country` = '$country', 
`state` = '$state', 
       `zipcode` = '$zipcode', 
       `status` = '$status', 
       `hometown` ` = '$hometown', 
       `zodiac` = '$zodiac', 
       `occupation` = '$occup', 
       `headline` = '$headline', 
       `header` = '$header', 
       `about_me` = '$about_me',
       `newpic` = '$newpic', 
       `orientation` = '$orientation'
      WHERE 
       (`userid` = $sid)"
;
      
      
$db->query($update);
  } else {
      
  echo 
'<h2>Profile Information
  </h2>
  <br />
  <form method="post">
  <b>First name:
    <input type="text" name="firstname" />
    <br />
    Last name:
    <input type="text" name="lastname" />
    <br />
    Age:
    <input type="text" name="realage" />
    <br />
    <br />
    <br />
    <h3>Location
    </h3>
    <br />
    City:
    <input type="text" name="realcity" />
    <br />
    Country:
    <input type="text" name="country" />
    <br />
    State:
    <input type="text" name="state" />
    <br />
    Zip Code:
    <input type="text" name="zipcode" />
    <br />
    <br />
    <h3>Details:
    </h3>
    <br />
    Marital Status:
    <input type="text" name="status" />
    <br />
    Orientation:
    <select name="orientation">
      <option value="BI">BI</option>
      <option value="Gay/Lesbian">Gay/Lesbian</option>
      <option value="Straight">Straight</option>
      <option value="Not Sure">Not Sure</option>
      <option value="N/A" selected>No Answer</option>
    </select>
    <br />
    Hometown:
    <input type="text" name="hometown" />
    <br />
    Zodiac Sign:
    <input type="text" name="zodiac" />
    <br />
    Occupation:
    <input type="text" name="occup" />
    <br />
    Headline:
    <input type="text" name="headline" />
    <br />
    <br />
    <h3>Change Profile Pictures:
    </h3>
    <br />
    Header:
    <input type="text" name="header"  />
    <br />
    Profile Pic:
    <input type="text" name="newpic" value="' 
$ir['display_pic'] .'" />
    <br />
    <br />
    <h3>About Me:
    </h3>
      <textarea name="about_me" cols=40 rows=6></textarea>
    <br />
    <br />
        <input type="submit">
    </form>'
;
  }
 
  
$h->endpage();

?>
« Last Edit: October 12, 2009, 06:49:22 AM by Spudinski »
Logged
If you see a post that just doesn't just seem right, send me a PM.
Offering services for small-type games and websites, send me a PM if you want/need something done.
 


This forum is now closed and has moved to a new location! Click here to find out why.