_REQUEST["subject"] subject _REQUEST["author"]author _REQUEST["news"]no value
_REQUEST["table"]
Array
(
[0] => news_main
)
_REQUEST["submit"]submit News _GET["subject"] subject _GET["author"]author
_GET["news"]no value _GET["table"]
Array
(
[0] => news_main
)
_GET["submit"]submit News that is what i am getting from the server, its just
weird, because everyother webhosting company i have gone through, i have never
had this much trouble dealing with the data sent via a form
Mike <[EMAIL PROTECTED]> wrote: you kind of
lost me here - table is an array as you declared it in your code.
It sounds to me like you are not sure where or how data in forms is passed
back to the server.
Try this - instead of echoing the table, look at what the server sees using
the phpinfo() function
In your code
if ($_GET['submit']) {
phpinfo();
}
Then look down the resulting page - way down near the bottom in the section
titled PHP Variables - you should see how the form data looks to the server -
in the $_GET array - probably also in the $_REQUEST array
phpinfo is your friend :-)
----- Original Message -----
From: kevin myers
To: [email protected]
Sent: Friday, September 08, 2006 10:16 AM
Subject: Re: [php_mysql] submit not working
Thanks, thats what it was, but now the information in the variable table is
not being passed over. I tried useing the $_GET['table'] mothod, but it seems
to me that the information isn't being added the right way, because i echo the
value of $table, and i get Array as the value
Mike <[EMAIL PROTECTED]> wrote: the default method for a form is GET, so where
you inspect $submit, try $_GET['submit']
----- Original Message -----
From: shaggy2dope2126
To: [email protected]
Sent: Friday, September 08, 2006 2:11 AM
Subject: [php_mysql] submit not working
heres the source code to a news system that i am building for my
website, but for some reason when i hit submit, its not registering
that i am hitting it, and it displays the form again. i know its
doing this because i made a dummy page that displays a message if
submit is working, or not and it shows its not, if anyone has any
ideas on where i might have messed up, i would really like to know:
--note, its three in the morning where i am at, so bare with me
<?php
require '/home/ravensle/includes/sql.class.php';
$sql = new sql();
$sql->connect();
$table = array();
this is for the sql code to input the information into the table i need
if($submit)
{
echo $table;
//this is for the query section on where to input the data
if(count($table) > 1)
{
for ($X = 0; $X <= count($table); $X++)
{//insert date into table
$sql->query("INSERT INTO " . $table . "(id, subject, news, date,
author) VALUES (' ',$subject,$news,now(),$author)");
}
}
else
{
die("You are missing the table name");
}//ends the if table loop
}
else
{
//this is for the section where i display the form
?>
<form action = "<?php echo $php_self; ?>">
Subject:<input type="text" name="subject" value=" subject"> by
<input type="text" name="author" value="author"><br>
<textarea name="news" rows=5 cols=75></textarea><br>
<input type="checkbox" name="table[]" value="news_main" checked>News
Main<br>
<input type="checkbox" name="table[]" value="articles_main">Articles
Main<br>
<input type="checkbox" name="table[]" value="magic_news_main">Magic
News Main<br>
<input type="checkbox" name="table[]"
value="pirates_news_main">Pirates News Main<br>
<input type="checkbox" name="table[]" value="vs_news_main">VS News
Main<br>
<input type="checkbox" name="table[]"
value="yugioh_news_main">Yu-Gi-Oh! News<br>
<input type="checkbox" name="table[]"
value="magic_articles_main">Magic Articles Main<br>
<input type="checkbox" name="table[]"
value="pirates_articles_main">Pirates Articles Main<br>
<input type="checkbox" name="table[]" value="vs_articles_main">VS
Articles Main<br>
<input type="checkbox" name="table[]"
value="yugioh_articles_main">Yu-Gi-Oh! Articles Main<br>
<input type="submit" name="submit" value="submit News">
</form>
<?php
}//ends the else statement
?>
[Non-text portions of this message have been removed]
---------------------------------
Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small
Business.
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
---------------------------------
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail.
[Non-text portions of this message have been removed]
The php_mysql group is dedicated to learn more about the PHP/MySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/