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]



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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/php_mysql/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> 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/
 


Reply via email to