timz | Bonjour,
j'ai essayé de faire ce formulaire, mais il me crée que des variables vides, pourtant j'ai activé register_global.
On dirait que le formulaire ne récupère pas mes données entrées.
Quelqu'un peut m'aiguiller?
Merci
Code :
- <html>
- <head>
- </head>
- <body>
- <?php
- echo $test;
- if(isset($test) && $test=="1" ){
- echo "isset";
- define("DB_HOSTNAME","localhost" );
- define("DB_USERNAME","root" );
- define("DB_PASSWD","" );
- define("DB_DATABASE","rouge" );
- $obj_db = @mysql_connect(DB_HOSTNAME,DB_USERNAME,DB_PASSWD) or die (mysql_error());
- @mysql_select_db(DB_DATABASE,$obj_db) or die (mysql_error());
- $titletext = 'Menu du ' + $f_date;
- $introtext = 'Voici le Menu';
- $maintext = $f_lundi + $f_mardi + $f_mercredi + $f_jeudi + $f_vendredi + $f_samedi + $f_dimanche;
- $publishdate = date('d-m-Y, H:i');
- @mysql_query("
- INSERT INTO jos_content (
- title,
- introtext,
- `fulltext`,
- state,
- sectionid,
- mask,
- catid,
- created,
- created_by,
- checked_out,
- publish_up,
- attribs,
- version,
- access,
- ordering
- ) VALUES (
- '". $titletext ."',
- '". $introtext ."',
- '". $maintext ."',
- '1',
- '5',
- '0',
- '36',
- '". $publishdate ."',
- '62',
- '0',
- '". $publishdate ."',
- 'introtext=0
- createdate=1',
- '1',
- '0',
- '99'
- )
- ",$obj_db) or die(mysql_error());
-
-
- if ($obj_db) {
- @mysql_close($obj_db);
- }
- }
- echo '<form method="post" action="'.$PHP_SELF.'" >';
- ?>
- <input type="hidden" name="test" value ="1">
- <table border=1 align=center>
- <tr>
- <td colspan=2>Menu de la semaine:</td>
- </tr>
- <tr>
- <td>Date:<input type="text" name="f_date" size="40"></td>
- <td>Lundi:<input type="text" name="f_lundi" size="40"></td>
- <td>Mardi:<input type="text" name="f_mardi" size="40"></td>
- <td>Mercredi:<input type="text" name="f_mercredi" size="40"></td>
- <td>Jeudi:<input type="text" name="f_jeudi" size="40"></td>
- <td>Vendredi:<input type="text" name="f_vendredi" size="40"></td>
- <td>Samedi:<input type="text" name="f_samedi" size="40"></td>
- <td>Dimanche:<input type="text" name="f_dimanche" size="40"></td>
- </tr>
- <td><input type="submit" value="envoyer"></td>
- </tr>
- </table>
- </form>
- </body>
- </html>
|
Message édité par timz le 15-05-2008 à 16:39:06
|