Non-executing code breaking page?

A multipurpose module, plugin and component

Non-executing code breaking page?

New postby [email protected] » Wed Feb 16, 2011 1:10 am

I've been throwing together a quick RSVP form for my wedding on my website, and ran into a strange issue - I embedded the following into my Joomla site through Jumi, but for some reason, it causes a blank page with no source code to display. The really strange part is that if I comment out everything inside my second 'If' statement, the page loads normally... even though that 'If' statement isn't being triggered. I tried uncommenting the code one line at a time and it failed immediately - it seems that I can't even assign a variable (or even consider assigning a variable, considering that code shouldn't be executing).

Am I using Jumi incorrectly? I don't even know where to start solving this one...

Code: Select all
<?
   $mysqli = new mysqli("XX", 'XXX', 'XXXX, 'XXXXX');

   /* check connection */
   if (mysqli_connect_errno()) {
      printf("Connect failed: %s\n", mysqli_connect_error());
      exit();
   }
   
   if (isset($_POST['name']) && count($_POST) >= 4)
   {
   echo 'fffffffffffuuuuuuuuuuuuuuu-';
   
      $name = mysqli_real_escape_string($_POST['name']);
      /*
      $attendingdinner = $_POST['attendingdinner'];
      $attendingceremony = $_POST['attendingceremony'];
      $attendingreception = $_POST['attendingreception'];
   
      if (isset($_POST['comments'])
      {
      $comments = mysqli_real_escape_string($_POST['comments']);
      }
      
      $insertion = "INSERT INTO _rsvp ('name', 'attendingdinner', 'attendingceremony', 'attendingreception'";
      if (isset($_POST['guest']))
      {
         $insertion .= ", 'guest'";
      }
      if (isset($_POST['comments']))
      {
         $insertion .= ", 'comments'";
      }
      $insertion .= ") VALUES (" . $name . ", " . $attendingdinner . ", " . $attendingceremony . ", " . $attendingreception;
      if (isset($_POST['comments']))
      {
         $insertion .= ", " . $comments;
      }
      $insertion .= ");" ;
      
      echo $insertion;
      
      
      
      if ($result = $mysqli->query($insertion)
      {
         echo 'Great success!';
      }
      /*
   }
   
   print_r($_POST);
   
   echo "<form name='input' action='XXX' method='POST'>
         Name: <input type='text' name='name' /> <br /><br />
         Attending Welcome Dinner - May 20 <br / > <input type='radio' name='attendingdinner' value='true' checked='yes'/> Yes! &nbsp &nbsp
                        <input type='radio' name='attendingdinner' value='false' /> No <br /><br />
         Attending Ceremony <br / ><input type='radio' name='attendingceremony' value='true' checked='yes'/> Yes! &nbsp &nbsp
                        <input type='radio' name='attendingceremony' value='false' /> No <br /><br />
         Attending Reception <br / ><input type='radio' name='attendingreception' value='true' checked='yes'/> Yes! &nbsp &nbsp
                        <input type='radio' name='attendingreception' value='false' /> No <br /><br />
         Guest: <input type='text' name='guest' /> <br />
         Comments: <br />
         <textarea rows='4' cols='60' name='comments'> </textarea> <br />
         <input type='submit' value='RSVP!' /> <br /> <br />
         </form>";
         
      print_r($_SESSION);
         
?>
[email protected]
 
Posts: 1
Joined: Wed Feb 16, 2011 12:59 am

Return to Jumi

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests

cron