Weird problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ice_mouton
Forum Newbie
Posts: 2
Joined: Fri Jun 13, 2003 2:06 pm
Location: Laval, QC
Contact:

Weird problem

Post by ice_mouton »

hello! I am new here and this is my first post. I am rather new at php but not at all to web developping.

I have made a simple subscription form and have uploaded it on 2 different servers :

http://www.thecgp.com/test2/bene.php
and
http://www.arts-orford.org/htmls/bene.php

Now the form is in french but basically it's a volunteer submission form.

Normally if you just click accept at the bottom it returns an error stating that you should fill in some info...

IT WORKS GREAT! ...

except that the http://www.arts-orford one doesn't...

It is the same script and same file... I got hint that maybe they were using php4 with global variables off on that one (the 1st one is my own server) so I tried another version of the code... anyway here is the code for the original, and my try at a non-global version ...

-----------------------------------------------------------------------------------
Bene.php - Copyright (c) 2003 By Francois Wilhelmy

Code: Select all

<html>

<head>

<title>Inscription Benevoles</title>
</head>

<body topmargin="0" leftmargin="0">
<?php
/* Declare */
function print_form($acceuil, $surveillance, $appui, $envoi, $miseajour, $collecte, $abonnements, $benefice, $suggestions, $nom, $addresse, $tel, $courriel) {
?>
<h1><span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">&nbsp;</span></h1>
<h1 style="margin-bottom: 0">
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">
<img border="0" src="logo.bmp" width="288" height="95">&nbsp;</span></h1>
<h1 style="margin-bottom: 0"><b>
<span lang="FR-CA" style="font-size: 16.0pt; font-family: Lucida Grande">
BÉNÉVOLES</span></b></h1>
<p class="MsoNormal" align="center" style="text-align: center; margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoBodyText" style="margin-bottom: 0">
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">Le 
Centre d’Arts Orford a grandement besoin de la collaboration de bénévoles pour 
la réalisation de ses diverses activités. Si vous souhaitez participer 
activement au développement du Centre d’Arts, nous vous invitons à remplir le 
formulaire ci-dessous.</span></p>
<p class="MsoNormal" style="text-align: justify; margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">Activités faisant appel 
aux bénévoles&nbsp;:</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>

<form method="POST" action="bene.php">
<h2 style="margin-bottom: 0"><u>
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">Été
</span></u>
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">(du 15 
juin au 30 août)</span></h2>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">(<input type="checkbox" name="acceuil" value="OUI">) Accueil aux concerts</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">(<input type="checkbox" name="surveillance" value="OUI">) Surveillance aux 
expositions</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">(<input type="checkbox" name="appui" value="OUI">) Appui à la 
réalisation de l’événement bénéfice</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0"><u>
<span lang="FR-CA" style="font-family: Lucida Grande">Automne</span></u><span lang="FR-CA" style="font-family: Lucida Grande">/<u>Hiver</u></span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (<input type="checkbox" name="envoi" value="OUI">) Participation à 
l’envoi des brochures de l’école</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (<input type="checkbox" name="miseajour" value="OUI">) Mise à jour de 
certains fichiers informatiques</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (<input type="checkbox" name="collecte" value="OUI">) Participation à 
la campagne de collecte de fonds</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<h3 style="margin-bottom: 0">
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">
Printemps</span></h3>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (<input type="checkbox" name="abonnements" value="OUI">) Participation à 
la campagne d’abonnements</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (<input type="checkbox" name="benefice" value="OUI">) Participation à 
l’organisation d’activités bénéfice</span></p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
Suggestions ?</p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0" align="left">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;<textarea rows="5" name="suggestions" cols="20"><?=$suggestions ?></textarea></span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">Nom&nbsp;: &nbsp;&nbsp;&nbsp;
<input type="text" name="nom" size="40" value="<?=$nom ?>"></span></p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
&nbsp;</p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
Addresse :</p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;
<textarea rows="4" name="addresse" cols="20"><?=$addresse ?></textarea></span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">Tél.
<input type="text" name="tel" size="20" value="<?=$tel ?>">&nbsp;Courriel
<input type="text" name="courriel" size="20" value="<?=$courriel ?>"></span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<input type="submit" value="Soumettre Ma Candidature" name="accept"></p>
<p class="MsoNormal" style="margin-bottom: 0">
&nbsp;</p>
</form>
<h2 style="margin-bottom: 0">
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">Pour 
toute information supplémentaire ou pour vous inscrire, communiquez avec Judith 
Munger au 819-843-3981 poste 251.&nbsp; ou Dominique Gill poste 237</span></h2>
<?
}
function check_form($acceuil, $surveillance, $appui, $envoi, $miseajour, $collecte, $abonnements, $benefice, $suggestions, $nom, $addresse, $tel, $courriel){

  if(!$nom || !$addresse || !$tel || !$courriel) {
   print ("<H3>Veuillez entrer votre nom, addresse téléphone et courriel ! </H3>");
   print_form($acceuil, $surveillance, $appui, $envoi, $miseajour, $collecte, $abonnements, $benefice, $suggestions, $nom, $addresse, $tel, $courriel);
  } else {
   confirm_form($acceuil, $surveillance, $appui, $envoi, $miseajour, $collecte, $abonnements, $benefice, $suggestions, $nom, $addresse, $tel, $courriel);
  }
}  
function confirm_form($acceuil, $surveillance, $appui, $envoi, $miseajour, $collecte, $abonnements, $benefice, $suggestions, $nom, $addresse, $tel, $courriel) {
// MAILMAILMAILMAILMAILMAILMAILMAIL
print ("<H1>MERCI DE VOTRE INSCRIPTION</H1>");
print ("Voici une copie du message envoyé aux responsables :");
$today = date("D M j G:i:s T Y");
/* recipients */
$to .= "iCe <ice_mouton@thecgp.com>";

/* subject */
$subject = "[$today] Inscription en ligne pour le Centre d'arts d'orford";

/* message */
$message = '<h2 style="margin-bottom: 0"><u>
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">Été
</span></u>
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">(du 15 
juin au 30 août)</span></h2>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">(' .$acceuil .') Accueil aux concerts</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">(' .$surveillance .') Surveillance aux 
expositions</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">(' .$appui .') Appui à la 
réalisation de l’événement bénéfice</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0"><u>
<span lang="FR-CA" style="font-family: Lucida Grande">Automne</span></u><span lang="FR-CA" style="font-family: Lucida Grande">/<u>Hiver</u></span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (' .$envoi .') Participation à 
l’envoi des brochures de l’école</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (' .$miseajour .') Mise à jour de 
certains fichiers informatiques</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (' .$collecte .') Participation à 
la campagne de collecte de fonds</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<h3 style="margin-bottom: 0">
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">
Printemps</span></h3>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (' .$abonnements .') Participation à 
la campagne d’abonnements</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (' .$benefice .') Participation à 
l’organisation d’activités bénéfice</span></p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
Suggestions ?</p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0" align="left">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;' .$suggestions .'</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">Nom&nbsp;: &nbsp;&nbsp;&nbsp;
' .$nom .'</span></p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
&nbsp;</p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
Addresse :</p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;
' .$addresse .'</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">Tél.
' .$tel .'&nbsp;Courriel
' .$courriel .'</span></p>';
print $message;
/* To send HTML mail, you can set the Content-type header. */
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* and now mail it */
mail($to, $subject, $message, $headers);
}
/* Prog Start */
if(!$accept):
print_form("", "", "", "", "", "", "", "", "", "", "", "", "");
else:
check_form($acceuil, $surveillance, $appui, $envoi, $miseajour, $collecte, $abonnements, $benefice, $suggestions, $nom, $addresse, $tel, $courriel);
endif;
?>
</body></html>
-------------------------------------------------------------------------------------

Bene.php4 - Copyright (c) 2003 By Francois Wilhelmy

Code: Select all

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Inscription Benevoles</title>
</head>

<body topmargin="0" leftmargin="0">
<?php
/* Declare */
function print_form($acceuil, $surveillance, $appui, $envoi, $miseajour, $collecte, $abonnements, $benefice, $suggestions, $nom, $addresse, $tel, $courriel) {
?>
<h1><span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">&nbsp;</span></h1>
<h1 style="margin-bottom: 0">
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">
<img border="0" src="logo.bmp" width="288" height="95">&nbsp;</span></h1>
<h1 style="margin-bottom: 0"><b>
<span lang="FR-CA" style="font-size: 16.0pt; font-family: Lucida Grande">
BÉNÉVOLES</span></b></h1>
<p class="MsoNormal" align="center" style="text-align: center; margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoBodyText" style="margin-bottom: 0">
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">Le 
Centre d’Arts Orford a grandement besoin de la collaboration de bénévoles pour 
la réalisation de ses diverses activités. Si vous souhaitez participer 
activement au développement du Centre d’Arts, nous vous invitons à remplir le 
formulaire ci-dessous.</span></p>
<p class="MsoNormal" style="text-align: justify; margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">Activités faisant appel 
aux bénévoles&nbsp;:</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>

<form method="GET" action="bene.php">
<h2 style="margin-bottom: 0"><u>
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">Été
</span></u>
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">(du 15 
juin au 30 août)</span></h2>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">(<input type="checkbox" name="acceuil" value="OUI">) Accueil aux concerts</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">(<input type="checkbox" name="surveillance" value="OUI">) Surveillance aux 
expositions</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">(<input type="checkbox" name="appui" value="OUI">) Appui à la 
réalisation de l’événement bénéfice</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0"><u>
<span lang="FR-CA" style="font-family: Lucida Grande">Automne</span></u><span lang="FR-CA" style="font-family: Lucida Grande">/<u>Hiver</u></span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (<input type="checkbox" name="envoi" value="OUI">) Participation à 
l’envoi des brochures de l’école</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (<input type="checkbox" name="miseajour" value="OUI">) Mise à jour de 
certains fichiers informatiques</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (<input type="checkbox" name="collecte" value="OUI">) Participation à 
la campagne de collecte de fonds</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<h3 style="margin-bottom: 0">
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">
Printemps</span></h3>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (<input type="checkbox" name="abonnements" value="OUI">) Participation à 
la campagne d’abonnements</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (<input type="checkbox" name="benefice" value="OUI">) Participation à 
l’organisation d’activités bénéfice</span></p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
Suggestions ?</p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0" align="left">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;<textarea rows="5" name="suggestions" cols="20"><?=$suggestions ?></textarea></span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">Nom&nbsp;: &nbsp;&nbsp;&nbsp;
<input type="text" name="nom" size="40" value="<?=$nom ?>"></span></p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
&nbsp;</p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
Addresse :</p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;
<textarea rows="4" name="addresse" cols="20"><?=$addresse ?></textarea></span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">Tél.
<input type="text" name="tel" size="20" value="<?=$tel ?>">&nbsp;Courriel
<input type="text" name="courriel" size="20" value="<?=$courriel ?>"></span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<input type="submit" value="Soumettre Ma Candidature" name="accept"></p>
<p class="MsoNormal" style="margin-bottom: 0">
&nbsp;</p>
</form>
<h2 style="margin-bottom: 0">
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">Pour 
toute information supplémentaire ou pour vous inscrire, communiquez avec Judith 
Munger au 819-843-3981 poste 251.&nbsp; ou Dominique Gill poste 237</span></h2>
<?
}
function check_form($acceuil, $surveillance, $appui, $envoi, $miseajour, $collecte, $abonnements, $benefice, $suggestions, $nom, $addresse, $tel, $courriel){

  if(!$nom || !$addresse || !$tel || !$courriel) {
   print ("<H3>Veuillez entrer votre nom, addresse téléphone et courriel ! </H3>");
   print_form($acceuil, $surveillance, $appui, $envoi, $miseajour, $collecte, $abonnements, $benefice, $suggestions, $nom, $addresse, $tel, $courriel);
  } else {
   confirm_form($acceuil, $surveillance, $appui, $envoi, $miseajour, $collecte, $abonnements, $benefice, $suggestions, $nom, $addresse, $tel, $courriel);
  }
}  
function confirm_form($acceuil, $surveillance, $appui, $envoi, $miseajour, $collecte, $abonnements, $benefice, $suggestions, $nom, $addresse, $tel, $courriel) {
// MAILMAILMAILMAILMAILMAILMAILMAIL
print ("<H1>MERCI DE VOTRE INSCRIPTION</H1>");
print ("Voici une copie du message envoyé aux responsables :");
$today = date("D M j G:i:s T Y");
/* recipients */
$to .= "iCe <ice_mouton@thecgp.com>";

/* subject */
$subject = "[$today] Inscription en ligne pour le Centre d'arts d'orford";

/* message */
$message = '<h2 style="margin-bottom: 0"><u>
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">Été
</span></u>
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">(du 15 
juin au 30 août)</span></h2>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">(' .$acceuil .') Accueil aux concerts</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">(' .$surveillance .') Surveillance aux 
expositions</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">(' .$appui .') Appui à la 
réalisation de l’événement bénéfice</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0"><u>
<span lang="FR-CA" style="font-family: Lucida Grande">Automne</span></u><span lang="FR-CA" style="font-family: Lucida Grande">/<u>Hiver</u></span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (' .$envoi .') Participation à 
l’envoi des brochures de l’école</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (' .$miseajour .') Mise à jour de 
certains fichiers informatiques</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (' .$collecte .') Participation à 
la campagne de collecte de fonds</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<h3 style="margin-bottom: 0">
<span lang="FR-CA" style="font-size: 12.0pt; font-family: Lucida Grande">
Printemps</span></h3>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (' .$abonnements .') Participation à 
la campagne d’abonnements</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;&nbsp;&nbsp;&nbsp; (' .$benefice .') Participation à 
l’organisation d’activités bénéfice</span></p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
Suggestions ?</p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0" align="left">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;' .$suggestions .'</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">Nom&nbsp;: &nbsp;&nbsp;&nbsp;
' .$nom .'</span></p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
&nbsp;</p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
Addresse :</p>
<p class="MsoNormal" style="margin-bottom: 0; margin-top:0">
<span lang="FR-CA" style="font-family: Lucida Grande">&nbsp;
' .$addresse .'</span></p>
<p class="MsoNormal" style="margin-bottom: 0">
<span lang="FR-CA" style="font-family: Lucida Grande">Tél.
' .$tel .'&nbsp;Courriel
' .$courriel .'</span></p>';
print $message;
/* To send HTML mail, you can set the Content-type header. */
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* and now mail it */
mail($to, $subject, $message, $headers);
}
/* Prog Start */
if(!$_GET["accept"]):
//print_form("", "", "", "", "", "", "", "", "", "", "", "", "");
print_form($_GET["acceuil"], $_GET["surveillance"], $_GET["appui"], $_GET["envoi"], $_GET["miseajour"], $_GET["collecte"], $_GET["abonnements"], $_GET["benefice"], $_GET["suggestions"], $_GET["nom"], $_GET["addresse"], $_GET["tel", $_GET["courriel"]);
else:
check_form($_GET["acceuil"], $_GET["surveillance"], $_GET["appui"], $_GET["envoi"], $_GET["miseajour"], $_GET["collecte"], $_GET["abonnements"], $_GET["benefice"], $_GET["suggestions"], $_GET["nom"], $_GET["addresse"], $_GET["tel", $_GET["courriel"]);
endif;
?>


</body>

</html>
--------------------------------------------------------------------------------

Note that when I tried the ?php4? version nothing appeared on the arts-orford.org server....


Thank you for all your help !
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Post by redhair »

i think this part is the bottleneck..

Code: Select all

<?php
 if(!$nom || !$addresse || !$tel || !$courriel)
?>
in your function check_form
ice_mouton
Forum Newbie
Posts: 2
Joined: Fri Jun 13, 2003 2:06 pm
Location: Laval, QC
Contact:

Post by ice_mouton »

what would you suggest ?
void
Forum Newbie
Posts: 3
Joined: Sat Jun 14, 2003 5:21 pm

Post by void »

I would've used a javascript to check the form, saves traffic and load on the server, but that isn't an answer to your question.

To check if a variable is set one can use empty($var) or isset($var). If $var is empty, empty() returns true and isset() return false.

So perhaps:

Code: Select all

<?php
if(empty($nom) || empty($addresse) || empty($tel) || empty($courriel))
?>
might work.

This http://www.blueshoes.org/en/developer/p ... cCp=&bcCt= could also be to some help.
Post Reply