S
skinnypspplayer
Guest
I have a button that I want to click and be able to insert form data into a MySQL table. The button is this..
<form action="accept_sub.php" method="get">
<input type="hidden" name="id" value="'.$row[id].'">
<input type="hidden" name="name" value="'.$row[name].'">
<input type="hidden" name="articletitle" value="'.$row[articletitle].'">
<input type="hidden" name="articletext" value="'.$row[articletext].'">
<input type="hidden" name="catagory" value="'.$row[catagory].'">
<input type="submit" value="Accept">
</form>
And the accept_sub.php (the file that inserts the data into a database)..
<?php include('../session.php');?>
<?php
$name = $_GET["name"];
$articletitle = $_GET["articletitle"];
$articletext = $_GET["articletext"];
$reviewgame = $_GET["reviewgame"];
$reviewtext = $_GET["reviewtext"];
$reviewrating = $_GET["reviewrating"];
$videourl = $_GET["videourl"];
$comicurl = $_GET["comicurl"];
$news = $_GET["news"];
$source = $_GET["source"];
$catagory = $_GET["catagory"];
$id = $_GET["id"];
$sql="INSERT INTO form_data2 (name, articletitle, articletext, reviewgame, reviewtext, reviewrating, videourl, comicurl, news, source, catagory, id)
VALUES
('$name','$articletitle','$articletext','$reviewgame','$reviewtext','$reviewrating','$videourl','$comicurl','$news','$source','$catagory','$id')";
?>
I'm pretty new at PHP and don't know what I'm doing wrong. Oh and there are some extra $_GET['blah'] things for more data because there will be different buttons (for different content) leading to this same page. Any help is appreciated
<form action="accept_sub.php" method="get">
<input type="hidden" name="id" value="'.$row[id].'">
<input type="hidden" name="name" value="'.$row[name].'">
<input type="hidden" name="articletitle" value="'.$row[articletitle].'">
<input type="hidden" name="articletext" value="'.$row[articletext].'">
<input type="hidden" name="catagory" value="'.$row[catagory].'">
<input type="submit" value="Accept">
</form>
And the accept_sub.php (the file that inserts the data into a database)..
<?php include('../session.php');?>
<?php
$name = $_GET["name"];
$articletitle = $_GET["articletitle"];
$articletext = $_GET["articletext"];
$reviewgame = $_GET["reviewgame"];
$reviewtext = $_GET["reviewtext"];
$reviewrating = $_GET["reviewrating"];
$videourl = $_GET["videourl"];
$comicurl = $_GET["comicurl"];
$news = $_GET["news"];
$source = $_GET["source"];
$catagory = $_GET["catagory"];
$id = $_GET["id"];
$sql="INSERT INTO form_data2 (name, articletitle, articletext, reviewgame, reviewtext, reviewrating, videourl, comicurl, news, source, catagory, id)
VALUES
('$name','$articletitle','$articletext','$reviewgame','$reviewtext','$reviewrating','$videourl','$comicurl','$news','$source','$catagory','$id')";
?>
I'm pretty new at PHP and don't know what I'm doing wrong. Oh and there are some extra $_GET['blah'] things for more data because there will be different buttons (for different content) leading to this same page. Any help is appreciated