UGN Security Forums
My ProfileMember DirectoryLogin
Search our ForumsView our FAQView our Site Rules
View our CalendarView our Active TopicsGo to our Main Page

UGN Security Store
 

Network Sites UGN Security, The GoNix Initiative, Elite Web Gamers, Back of the Web, EveryDay Helper, VNC Web Design & Development
August
Su M Tu W Th F Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Sponsored Links
Latest Postings
Amazon Gift Card Generator/KeyGen?te
by Gecko666
08/22/14 09:21 AM
Latest Reviews
Topic Options
Rate This Topic
#19461 - 07/03/03 04:32 PM PHP/MySQL Problem in Feedback Feature
Cold Sunn Offline
UGN GFX Whore

Registered: 03/03/02
Posts: 574
Loc: us
I have a post comments feature on my site for different essays or short stories. The problem is, instead of adding what you typed for Name, Email, Site, and Comment, it adds a 0 to the db. Everything else works, stuff that you can't change in the form like ip address, timestamp, and the id of the article you are commenting on. Any idea why it does this? I'll give you more info if you want. Thanks for any help, I've spent so much time trying to figure this shit out.

Here is the code for the page that does the adding, which is seperate from the page you post from:
Code:
<?PHP
include("dbconnect.php");

IF($nraktion == "ssub") {

    IF ($wc_name == "name") {
        $wc_name = "A Stranger";
    } ELSEIF ($wc_name == "" ) {
            $wc_name = "A Stranger";
}
    IF ($wc_email == "email") {
        $wc_email = "none";
    } ELSEIF ($wc_email == "" ) {
            $wc_email = "none";
}
    IF ($wc_site == "http://") {
        $wc_site = "none";
    } ELSEIF ($wc_site == "" ) {
            $wc_site = "none";
}

IF ($wc_content == "") {
    echo ("You radge, you left the message box blank and should be banned from the internet entirely.");
} ELSE {
$ip = getenv("REMOTE_ADDR");
mysql_query("INSERT INTO writcomments (ip,nid,name,email,site,content,timestamp) VALUES ('$ip','$nid','$wc_name','$wc_email','$wc_site','$wc_content',".time().")");
ECHO ("<img src=main/post/posting.gif alt=\"Posting\">");
} //END ELSE FOR CONTENT
} //END IF NRAKTIOn == SSUB
?>
And yes, I know. include is dying and require is the way to go. I know. Whatever.

Top
Sponsored Links
      
#19462 - 07/03/03 08:20 PM Re: PHP/MySQL Problem in Feedback Feature
ninjaneo Offline
UGN Security Staff

Registered: 03/06/02
Posts: 256
Loc: CA, USA
Code:
<?PHP
 require "dbconnect.php";
 IF($nraktion == "ssub") {    
  $wc_name = ($wc_name == "name" &#0124;&#0124; $wc_name == "" ? "A Stranger" : $wc_name);
  $wc_site = ($wc_site == "http://" &#0124;&#0124; $wc_site == "" ? "none" : $wc_site);
  IF ($wc_content == "") {
   echo ("You radge, you left the message box blank and should be banned from the internet entirely.");
  } ELSE {
   $ip = getenv("REMOTE_ADDR");
   mysql_query("INSERT INTO `writcomments` (`ip`,`nid`,`name`,`email`,`site`,`content`,`timestamp`) VALUES ('$ip','$nid','$wc_name','$wc_email','$wc_site','$wc_content','".time()."');") 
               or die(mysql_error());
   ECHO ("<img src=main/post/posting.gif alt=\"Posting\">");
  }
 }
?>
Thats some nice rewritten code /e shakes penis.

--edited--

Top
#19463 - 07/03/03 08:25 PM Re: PHP/MySQL Problem in Feedback Feature
Cold Sunn Offline
UGN GFX Whore

Registered: 03/03/02
Posts: 574
Loc: us
All I have to say is:

You have an error in your SQL syntax near '\'1057292661\')' at line 1

Top
#19464 - 07/04/03 01:22 PM Re: PHP/MySQL Problem in Feedback Feature
Cold Sunn Offline
UGN GFX Whore

Registered: 03/03/02
Posts: 574
Loc: us
Basically, all the information needed gets to the page with the code above. What is happening, is the mysql table is a closet homosexual. I'm going to try making a new table and hope it's straight this time.

Top
#19465 - 07/04/03 01:49 PM Re: PHP/MySQL Problem in Feedback Feature
Cold Sunn Offline
UGN GFX Whore

Registered: 03/03/02
Posts: 574
Loc: us
I created a new table and changed some code, now it works. It works like it should have worked the first time, but that would be too easy. The people at MySQL know that no one likes things to go smoothly which is why cars have shock-absorbers and why condoms are made of latex and prelubricated. Another thing that know is that I love taking it in the ass along with wasting like 4 hours on a problem that can't even decide it's sexuality.

Top

Moderator:  §intå×, Gremelin 
Featured Member
Registered: 08/20/13
Posts: 1
Forum Stats
2148 Members
46 Forums
33949 Topics
69116 Posts

Max Online: 1567 @ 04/25/10 02:20 AM
Top Posters
UGN Security 27111
Gremelin 7192
§intå× 3255
SilentRage 1273
Ice 1146
pergesu 1136
Infinite 1041
jonconley 955
Girlie 908
unreal 860
Newest Members
Gecko666, defghi795767, Devo60, ali, lavos
2147 Registered Users
Who's Online
0 registered (), 292 Guests and 307 Spiders online.
Key: Admin, Global Mod, Mod
Latest News


Donate
  Get Firefox!
Get FireFox!