Your browser does not seem to support CSS. If images appear below, please disregard them.
It appears that you're running an Ad-Blocker. This site is monetized by Advertising and by ">User Donations; we ask that if you find this site helpful that you whitelist us in your Ad-Blocker, or make a ">Donation to help aid in operating costs.
Previous Thread
Next Thread
Print Thread
Rate This Thread
#19461 - 07/03/03 11:32 PM PHP/MySQL Problem in Feedback Feature  
Joined: Mar 2002
Posts: 574
Cold Sunn Offline
UGN GFX Whore
Cold Sunn  Offline
UGN GFX Whore

Joined: Mar 2002
Posts: 574
Likes: 1
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 [censored] 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.

Sponsored Links
#19462 - 07/04/03 03:20 AM Re: PHP/MySQL Problem in Feedback Feature  
Joined: Mar 2002
Posts: 256
ninjaneo Offline
UGN Security Staff
ninjaneo  Offline
UGN Security Staff

Joined: Mar 2002
Posts: 256
Likes: 1
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 wink /e shakes [censored].

--edited--

#19463 - 07/04/03 03:25 AM Re: PHP/MySQL Problem in Feedback Feature  
Joined: Mar 2002
Posts: 574
Cold Sunn Offline
UGN GFX Whore
Cold Sunn  Offline
UGN GFX Whore

Joined: Mar 2002
Posts: 574
Likes: 1
us
All I have to say is:

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

#19464 - 07/04/03 08:22 PM Re: PHP/MySQL Problem in Feedback Feature  
Joined: Mar 2002
Posts: 574
Cold Sunn Offline
UGN GFX Whore
Cold Sunn  Offline
UGN GFX Whore

Joined: Mar 2002
Posts: 574
Likes: 1
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.

#19465 - 07/04/03 08:49 PM Re: PHP/MySQL Problem in Feedback Feature  
Joined: Mar 2002
Posts: 574
Cold Sunn Offline
UGN GFX Whore
Cold Sunn  Offline
UGN GFX Whore

Joined: Mar 2002
Posts: 574
Likes: 1
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 [censored] along with wasting like 4 hours on a problem that can't even decide it's sexuality.

Sponsored Links

Member Spotlight
Gremelin
Gremelin
Portland, OR; USA
Posts: 7,202
Joined: February 2002
Show All Member Profiles 
Forum Statistics
Forums41
Topics33,702
Posts68,797
Average Daily Posts0
Members2,172
Most Online1,567
Apr 25th, 2010
Latest Postings
Okay WTF?
by HenryMiring on 09/27/17 08:45 AM
The History Thread...
by Gremelin on 08/11/17 07:11 PM
my old account still exists!
by Gremelin on 08/11/17 07:02 PM
My friend NEEDS your HELP!
by Lena01 on 07/21/17 07:06 AM
I'm having fun with this guy.
by gabithompson730 on 07/20/17 08:50 AM
I want to upgrade my phone
by gabithompson730 on 07/20/17 08:49 AM
Newbie here
by gabithompson730 on 07/20/17 08:46 AM
Blackbeard.....
by Gremelin on 01/14/17 07:03 PM
Top Posters(All Time)
UGN Security 41,392
Gremelin 7,202
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Liked Users (All Time)
§intå× Likes: 3
Black Beard Likes: 1
Cold Sunn Likes: 1
Crime Likes: 1
Cyrez Likes: 1
fleshwound Likes: 1
Ghost Likes: 2
Gremelin Likes: 12
Ice Likes: 1
ninjaneo Likes: 1
Powered by UBB.threads™ PHP Forum Software 7.6.0
(Snapshot build 20170206)