Jump to content

NickG21

Members
  • Posts

    146
  • Joined

  • Last visited

    Never

Posts posted by NickG21

  1. hey everyone,
    i have multiple form pages that are storing all of the variables using

    [code]<?php session_start(); foreach($_POST as $key => $var) { $_SESSION[$key] = $var; } ?>[/code]

    I was wondering if anyone could give me an idea of a Loop that could go through these variables as soon as the "next" or "submit" buttons are pressed and just check to make sure none of them are empty?
  2. hey everyone, i have a multiple form page that i am trying to store all the information for and eventually send an e-mail
    right now i have all of the forms displaying in one page but i am unable to set the variables and get the information out of them in order to send them in an e-mail.  this is what i have gotten my code too.  the last form posts to formmail.php but only sends the last variable posted on that last form.  any idea what i could do?

    [code]          <?php
      session_start();
      foreach($_POST as $key => $var) {
        $_SESSION[$key] = $var;
      }
            IF (!isset($_POST['step'])) {
      include "ListInfo.php";}
    ELSEIF ($_POST['step'] == 2){
      include "OptServices.php";}
    ELSEIF ($_POST['step'] == 3){
    include "ContInfo.php";}
    ELSEIF ($_POST['step'] == 4){
    include "BillInfo.php";}
    ELSEIF ($_POST['step'] == 5){
    include "Survey.php";}
    ELSEIF ($_POST['step'] == 6){
    include "Terms.php";
    }
    ?>[/code]

    i have gotten my code down to this to display the pages thanks to some help around these forums
  3. the only php code i have between the pages is......
    [code]
    <?php
      session_start();
      foreach($_POST as $key => $var) {
        $_SESSION[$key] = $var;
      }
    ?>[/code]

    while on the last page i have:
    [code]<?php
      session_start();
    foreach($_SESSION as $key => $value)
    {
        echo "<input type='hidden' value='" . $value . "' name='value" . $key
    . "'>";
    }
    ?>
    [/code]
    i believed this would take every variable thus far and put it into a hidden field to be transferred into my mailing script template.  i attached the template
    [code]<form method="post" action="formmail.php">
    <input type="hidden" name="mail_options" value="PlainTemplate=plain.txt,TemplateMissing=n/a" />
    <input type="hidden" name="subject" value="Mailing List Hosting Signup"/>
    <input type="hidden" name="recipients" value="ngirard@netatlantic.com" />
    <input type="submit" value="Submit Information" name="submit"/>
    </form>[/code]

    [attachment deleted by admin]
  4. if this post is repetitive i apologize, i just have had no luck anywhere with help on this.
    i have 6 form pages that i am keeping track of with a single session, at the end of the pages i am looking to print a "Review Page" of all of the information entered by the user and then they finally submit the page and the information is e-mailed to me.  i have done everything i can think of to figure this out including echoing all of the information stored in the session on the page before submission to my formmail and everything is there but after i submit the last page the only information passed to the e-mail is the one variable stored on the last page.
    does anyone know how i could figure this out.

    plus i have done the tectite tutorials on mutiple form pages with formmail.php and it doesn't work at all for me, i dont know where to go from here
  5. i was wondering if there was anyway i could write up a basic template for a review page on my site after people have filled in all of their forms a page is displayed with all of the information to verify it?  i want a template so that the session variable names aren't all displayed but just the text that i specify?
  6. all of the form names have different names and values on all of the forms, i thought this would make it easier to be able to decipher all of the information that is sent to the e-mail, and as for writing my own script, i do not have much of an idea where to start, i am pretty new to PHP, also i was wondering if the fact that i never close the session has anything to do with the variables not being sent?

    thanks
  7. hey everyone,
          i am working on a signup page that uses 6 different forms.  in each page i use
    <?php
      session_start();
      foreach($_POST as $key => $var) {
        $_SESSION[$key] = $var;
      }
    ?>
    to store all the information that is submitted.  after the 6th and final form page is submitted i send the information to a formmail.php in order to e-mail all of the information to my e-mail address, however, the only thing submitted is the value of the last thing that was checked in the last form.  The thing i don't understand is that when i do an

    echo '<pre>', print_r($_SESSION, true), '</pre>';

    all of the information from all six forms is displayed on the last page but will not send in the mail.  can anyone help me out a little bit, all help is greatly appreciated
    thanks a lot
  8. will that code go through and take every individual piece that is submitted and put the name and value into a specific key of the session?

    To try and be a little more clear of my whole purpose i have a signup for service page broken into 6 different sections.  i am trying to have the user fill in one section, click a next button and have the next form load on the same page and store all of the information into either one or multiple session variables that will be able to be viewed and accessed after the 6th and final form is submitted.
    hope that helps a little more
  9. hey everyone im looking to make a signup form that will be located on 6 different forms.  i want to make it so each form is loaded individually while storing all of the previous information into a session variables.  is there anyway i can do this without going through these pages and declaring 50 different variables to store the individual data?  any help is appreciated
    thank you
  10. hey everyone, i was just wondering if anyone had any idea if there was a free currency conversion site that i could get constant updated currencies to be able to display on my pricing page?  i have searched google extensively for anything i could found and just seem to be coming up short.  any help is appreciated.
    thank you
  11. hey everyone i am looking to process information through the use of an image used as a button.  However, the function of if (isset($POST['subscribe'])) is not working.  Is there a different call to see if an image was submitted instead of a button?
    thank you in advance
  12. that isn't all of my code, what i am trying to do is if there is an error in one of the fields i want to change the text of the label from black to red say.  The only thing is that if i have the class change on any error than everyone of the classes are going to be printed in the red text instead of just the areas that had the errors in them.  here is my full code, if it helps.

    [code]<?php
    function checkEmail($email)
    {
      if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $email))
      {
          return FALSE;
      }
      list($Username, $Domain) = split("@",$email);
      if(getmxrr($Domain, $MXHost))
      {
          return TRUE;
      }
      else
      {
          if(@fsockopen($Domain, 25, $errno, $errstr, 15))
          {
            return TRUE;
          }
          else
          {
            return FALSE;
          }
      }
    }
    if (isset($_POST['submit'])) {
    $company = $_POST['CompanyName'];
    $name = $_POST['realname'];
    $email = $_POST['email'];
    $domainName = $_POST['ListOrDomainName'];
    $username = $_POST['Username'];
    $password = $_POST['Password'];
    $credit = $_POST['CreditCardNumber'];
    $text = ".basictext"
    $error = array();

    if (empty($name))
    {
    $error[] = "";
    }
    elseif (!preg_match("/^([a-zA-Z])+/",$name))
    {
      $error[] = "Your Name May Not Contain Numbers";
      $name="";
    }

    if(checkEmail($email) == FALSE)
    {
      $error[]="E-Mail Address";
      $email = "";
    }
    if (empty($password)){
    $error[]="";
    }
    elseif(strlen($password) < 6)
    {
    $error[]="Password";
    $text = ".errortext";
    }
    if(!preg_match("/^([0-9])+/",$credit)){
    $error[]="Credit Card Number";
    }
    if(count($error) > 0) {
        echo "<b>The Following Errors Were Found, Please Re-Enter:</b><br/>". implode('<br/>', $error). "</p>";
        } else {
    require_once("formmail.php");
        exit;
      }
    }
    ?>


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target=_blank>
    <html xmlns="http://www.w3.org/1999/xhtml" target=_blank>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Cancellation</title>
    <script language="javascript">
    <!--
    function DisableControlGroup(check, group)
    {
    var x, opt;
    if(check.checked)
    {
    opt = true;
    }
    else
    {
    opt = false;
    }
    for(x=0; x < group.length; x++)
    {
    group[x].disabled = opt;
    }
    }

    //-->
    </script>
    </head>
    <style>
        .basictext {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 14px; color:#000066;
        }
        .errortext {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 14px; color:#C00000; font-weight: bold;
        }
    </style>
    <body>
      <form method="post" action="ContactUs.php" name="form1" onSubmit="return checkCheckBox(this)">
    <!-- form content -->
    <table class="qForm">
    <tr>
    <td colspan="2" class="header">Contact Information:</td><td><font color="#FF0000"><span class="smalltype">*Required Field</font></span></td>
    </tr>
    <tr>
    <td class="left"><a><span class="<?print $text?>">Company Name:</td>

    <td><input name="CompanyName" size="28" value="<?echo "$company"?>"></td>
    </tr>
    <tr>
    <td class="left"><font color="#FF0000">Your Name :</font></td>
    <td><input name="realname" size="28" value="<?echo "$name"?>"></td>
    </tr>
    <tr>
    <td class="left"><font color="#FF0000">Your Email Address:</font></td>

    <td><input name="email" size="28" value="<?echo "$email"?>"></td>
    </tr>
    <tr>
    <td class="left">Your List Name or Domain Name:</td>
    <td><input name="ListorDomainName" size="28"></td>
    </tr>
    </table>
    <table class="qForm">

    <tr>
    <td class="header">Customer Verification Information</td>
    </tr>
    <tr>
    <td ><p class="specialnote"><strong>To verify the authenticity of
    your request</strong>, please supply your username and password or the
    last 6 digits of the credit card we have on file.  If you do not have
    this information please choose "resend the owners manual" and we will
    resend this information to the account owner.</p></td>
    </tr>
    <tr>

    <td style="padding: 0 0 0 20px; font-weight: bold; color:
    #96855E;">Option 1: Username and Password </td>
    </tr>
    </table>
    <table class="qForm">
    <tr>
    <td class="left">Username:</td>
    <td><input name="Username" id="request"></td>
    </tr>

    <tr>
    <td class="left">Password:</td>
    <td><input type="password" name="Password" id="request"></td>
    </tr>
    </table>
    <table class="qForm">
    <tr>
    <td style="padding: 0 0 0.5em 20px; font-weight: bold; color: #96855E;">

    Option 2: Last 6 Digits of Credit Card Number 
      <input name="CreditCardNumber" id="request" maxlength="6" size="6">
    </td>
    </tr>
    <tr>
    <td style="padding: 0 0 1em 20px; font-weight: bold; color:#96855E;">You are not able to provide either of above.
    <div style="margin: 0.6em 2em 0 3em; padding: 0.3em;
    background-color: #F5FAFF; border: 1px solid #C2E3F5; color: #000;
    font-weight: normal;">
    <input type="checkbox" name="Resemd" ID="OwnersManual" value="ResendOwnersManual" onClick="DisableControlGroup(this, request)">
    Request to resend the owners manual.
      <p class="note" style="padding: 0.3em 1em;  font-weight:
    normal;">Skip the rest of the fields and <a href="#submit">click the
    "Submit" button</a> at the bottom of the page.<br>

    For your protection, we cannot process your cancellation request
    until we confirm your customer verification information. </p>
    </div>
    </td>
    </tr>
    <tr>
    <td class="header">Service to Cancel</td>
    </tr>
    <tr>

    <td class="oneColumnOptions">
    <input name="ServiceName[]" id="request" type="radio" value="Announcement Email
    List Hosting"> Announcement Email List Hosting<br>
    <input name="ServiceName[]" id="request" type="radio" value="Discussion Email
    List Hosting"> Discussion Email List Hosting<br>
    <input name="ServiceName[]" id="request" type="radio" value="Web Hosting"> Web
    Site Hosting<br>
    <input name="ServiceName[]" id="request" type="radio" value="Pay Per Click Bid
    Management"> Pay Per Click Bid Management<br>

    <input name="ServiceName[]" id="request" type="radio" value="Dedicated Server">
    Dedicated Server Hosting<br>
    <input name="ServiceName[]" id="request" type="radio" value="Enterprise Email
    Filtering"> Enterprise Email Filtering<br>
    <input name="ServiceName[]" id="request" type="radio" value="Email / Webmail
    Accounts"> Email / Webmail Accounts<br>
    <input name="ServiceName[]" id="request" type="radio" value="Other"> Other
    <input name="ServiceName" id="request" size="30">
      </td>

    </tr>
    <tr>
    <td class="header">Reasons for Canceling <span class="note"
    style="padding-left: 1em; font-size: 80%;">(Check all that apply.)</span>
    </td>
    </tr>
    <tr>
      <td class="oneColumnOptions">
      <input type="checkbox" name="Reasons[]" id="request" value="NotUsing Service"> Not Using Service<br>

      <input type="checkbox" name="Reasons[]" id="request"
    value="Dissatisfied with Features of Service" id="request"> Dissatisfied with Features
    of Service<br>
    <input type="checkbox" name="Reasons[]"
    value="Ineffective Business Solution" id="request"> Ineffective Business Solution<br>
    <!-- specifically for mailing list -->
    <input type="checkbox" name="Reasons[]" id="request" value="Only Send Occational Mailings">    
    Only Send Occasional Mailings (<span class="note"
    style="font-weight: normal;">For Mailing List Hosting only</span>)<br>
                            <input type="checkbox" name="Reasons[]" id="request" value="Poor Delivery of Email Newsletter to Subscribers">
    Poor Delivery of Email Newsletter to Subscribers (<span class="note"
    style="font-weight: normal;">For Mailing List Hosting only</span>)<br>

    <!-- -->
    <input type="checkbox" name="Reasons[]" id="request" value="Found a
    Less Expensive Alternative"> Found a Less Expensive Alternative<br>
    <input type="checkbox" name="Reasons[]" id="request" value="Went
    with an In-house Solution"> Went with an In-house Solution<br>
    <input type="checkbox" name="Reasons[]" id="request"
    value="Technical Issues"> Technical Issues<br>
    <input type="checkbox" name="Reasons[]" id="request" value="Too
    Difficult to Use Service"> Too Difficult to Use Service<br>

    <input type="checkbox" name="Reasons[]" id="request"
    value="Dissatisfied with Technical Support"> Dissatisfied with Technical
    Support<br>

    <input type="checkbox" name="Reasons[]" id="request" value="Poor
    Customer Service"> Poor Customer Service<br>
    <input type="checkbox" name="Reasons[]" id="request" value="Poor
    Billing Process"> Poor Billing Process<br>
    <input type="checkbox" name="Reasons[]" id="request" value="Went
    Out of Business"> Went Out of Business<br>
    <input type="checkbox" name="Reasons[]" id="request" value="Sold
    Company"> Sold Company<br>
    <input type="checkbox" name="Reasons[]" id="request" value="Other">
    Other <input name="OtherReasons" id="request" size="30">

    </td>
    </tr>
    <tr>
    <td class="header">Comments or Feedback </td>
    </tr>
    <tr>
    <td class="oneColumnOptions"><textarea name="Reasons[]" id="request" cols="40"
    rows="6"></textarea></td>
    </tr>
    <tr>


    <input type="hidden" name="Subject" value="Cancellation Form" />
    <input type="hidden" name="required" value="realname, email, ListorDomainName" />
    <input type="hidden" name="recipients" value="ngirard@netatlantic.com" />
    <input type="hidden" name="mail_options" value="NoEmpty"/>
    <td style="padding: 1.5em 0; text-align: center;">
    <input type="submit" name="submit" value="Submit" /> 
      <input type="reset" value="Reset" /> </td>
    </tr>
    </table>
      </form>
    </body>
    </html>[/code]
  13. hey everyone, i have a form i am validting and was wondering if i could store the span class of my errors in a seperate array that would be able to redisplay the locations the errors occurred in an .errortext instead of say a .basictext?

    [code]if (isset($_POST['submit'])) {
    $company = $_POST['CompanyName'];
    $name = $_POST['realname'];
    $email = $_POST['email'];
    $domainName = $_POST['ListOrDomainName'];
    $username = $_POST['Username'];
    $password = $_POST['Password'];
    $credit = $_POST['CreditCardNumber'];
    $error1 = '';
    $error = array();

    if (empty($name))
    {
    $error[] = "Your Name";
    }
    elseif (!preg_match("/^([a-zA-Z])+/",$name))
    {
      $error[] = "Your Name May Not Contain Numbers";
      $name="";
    }

    if(checkEmail($email) == FALSE)
    {
      $error[]="E-Mail Address";
      $email = "";
    }
    if (empty($password)){
    $error[]="";
    }
    elseif(strlen($password) < 6)
    {
    $error[]="Password";
    }
    if(!preg_match("/^([0-9])+/",$credit)){
    $error[]="Credit Card Number";
    }
    if(count($error) > 0) {
        echo "<big><b>The Following Errors Were Found, Please Re-Enter:</b></big><br/>". implode('<br/>', $error). "</p>";
        } else {
    require_once("formmail.php");
        exit;
      }
    }
    ?>
    <style>
        .basictext {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 14px; color:#000066;
        }
        .errortext {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 14px; color:#C00000; font-weight: bold;
        }
    </style>
    <tr>
    <td class="left"><a><span class="<?print $text?>">Company Name:</td>

    <td><input name="CompanyName" size="28" value="<?echo "$company"?>"></td>
    </tr>
    <tr>
    <td class="left"><font color="#FF0000">Your Name :</font></td>
    <td><input name="realname" size="28" value="<?echo "$name"?>"></td>
    </tr>
    [/code]

    there are a few of the sections in my code where i would want to implement this.  any help is appreciated
    thank you
  14. alright, here is the general php validation i am trying to execute before the information is passed into formmail and below is just a small bit of the html code.
    [code]<?php
    function checkEmail($email)
    {
      if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $email))
      {
          return FALSE;
      }
      list($Username, $Domain) = split("@",$email);
      if(getmxrr($Domain, $MXHost))
      {
          return TRUE;
      }
      else
      {
          if(@fsockopen($Domain, 25, $errno, $errstr, 15))
          {
            return TRUE;
          }
          else
          {
            return FALSE;
          }
      }
    }
    if (isset($_POST['submit'])) {
    $company = $_POST['CompanyName'];
    $name = $_POST['YourName'];
    $email = $_POST['YourEmailAddress'];
    $domainName = $_POST['ListOrDomainName'];
    $username = $_POST['Username'];
    $password = $_POST['Password'];
    $credit = $_POST['CreditCardNumber'];
    $error1 = '';
    $error = array();

    if (empty($company))
    {
    $error[] = "Comapny";
    }
    if (empty($name))
    {
    $error[] = "Your Name";
    }
    elseif (!preg_match("/^([a-zA-Z])+/",$name))
    {
      $error[] = "Your Name";
      $name="";
    }

    if(checkEmail($email) == FALSE)
    {
      $error[]="E-Mail Address";
      $email = "";
    }
    if(empty($username))
    {
    $error[] = "User Name";
    }
    if(empty($password))
    {
    $error[]="Password";
    $password.class = "errortext";
    }
    elseif (strlen($password) < 6)
    {
    $error[]= "Password Must Contain At Least Six Characters";
    }
    if(empty($credit)){
    $error[]="Credit Card Number";
    }
    elseif(!preg_match("/^([0-9])+/",$credit))
    {
    $error[] = "Invalid Credit Card Number";
    }

    if(count($error) > 0) {
        echo "<big><b>The Following Errors Were Found, Please Re-Enter:</b></big><br/>". implode('<br/>', $error). "</p>";
        } else {
    header('Location: ./Thanks.php');
        exit;
      }
    }
    ?>[/code]

    [code]<table class="qForm">
    <tr>
    <td colspan="2" class="header">Contact Information</td>
    </tr>
    <tr>
    <td class="left"><a><span class="<?print $text?>">Company Name:</td>

    <td><input name="CompanyName" size="28" value="<?echo "$company"?>"></td>
    </tr>
    <tr>
    <td class="left">Your Name :</td>
    <td><input name="realname" size="28" value="<?echo "$name"?>"></td>
    </tr>
    <tr>
    <td class="left">Your Email Address:</td>

    <td><input name="email" size="28" value="<?echo "$email"?>"></td>
    </tr>
    <input type="hidden" name="Subject" value="Cancellation Form" />
    <input type="hidden" name="required" value="realname, email, ListorDomainName" />
    <input type="hidden" name="recipients" value="ngirard@netatlantic.com" />
    <td style="padding: 1.5em 0; text-align: center;">
    <input type="submit" name="submit" value="Submit" /> 
      <input type="reset" value="Reset" />[/code]
  15. hey everyone, i am using formmail.php in order to process one of my web forms and send everything out VIA e-mail.  i was wonderig if it was possible to do form validation on the page before it is passed through.  i have coding to verify the e-mail address is a valid domain with fsockopen, also just form fields containing only letters or numbers.  can i pass the values through these functions before they are sent to formmail.php?
    thanks in advance
  16. hey everyone here is my code for a function to disable a set of radio buttons.  i was wondering if anyone could help me and try to elaborate on how i could disable a group of checkboxes at the same time when this one checkbox is checked.
    [code]

    function DisableRadioGroup(radioGroup, disable)
    {
    if(document.getElementById("OwnersManual").checked == true){
      for(var i=0; i < radioGroup.length; i++)
      {
        radioGroup[i].disabled = true
      }
      }

    else
    {
      for(var i=0; i < radioGroup.length; i++)
      {
        radioGroup[i].disabled = false
      }
    }
    }[/code]
    onClick="DisableRadioGroup(ServiceName)"
  17. http://www.serviceobjects.com/support/dots_example_code.asp
    here are a few already written scripts and examples using NuSOAP and cURL, just download the examples and check them out, i am not familiar with them but they looked good to me, hope it helps
  18. i cant answer your question on function prototypes as i am new at this myself, but as for c, c++ and c# knowing these languages is good for any programming language you are trying to learn because the syntax is very similar especially in php.  it gives you all you need to know about calling functions, declaring variables, arrays, structure and how fluent your code is, it also makes sure you have good coding practices when you come up learning C before all the web languages.  in your case i'd say that learning c after you already know the languages you usually code with might be a slight step backward but would probably strengthen your understanding and knowledge overall
    hope that helps a little
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.