Menu

Newbie Needs a little help with 2 issues.

Help
ADT
2007-06-06
2013-06-03
  • ADT

    ADT - 2007-06-06

    Everything is working great as fasr as form validation and the email and database functions but I have to things I am trying to accomplish and having little to no experiance in php I was hoping I could get some help here.

    PROBLEM #1:

    I am using custom error and thank you pages by using the following style redirect

    header("Refresh: 0;url=http://www.mywebsite.com/errorpage.htm");
    header("Refresh: 0;url=http://www.mywebsite.com/thankyou.htm");

    What I am trying to accomplish is passing the data into thees custom pages for examples the error page I would like it to display the error messages from the process.php file. On the thank you page I would like it to show the information they submitted.

    If someone could show me how to pass the data I would appreciate it.

    PROBLEM #2:

    I want to trim the information being submitted on the form so that the database doesn't have extra whitespace but more importantly I do not get validation errors when there is trailing whitespace on the email address.

    I have tried using $Email=trim($Email); in the process.php file however I still get an error if there is any extra spaces after the email address.

    Any help on this would be appreciated.

     
    • TNTEverett

      TNTEverett - 2007-06-08

      #1, take a look at the process.php for a form that generates it's own thankyou page.  The HTML is at the bottom of the page and it includes short <?php ?> sections to display the form data.  I suggest you follw the same method and just paste your thankyou page html code into the end of the process.php file.  You can then modify this html by inserting the appropriate php code sections to display the data. 

      #2, the trim function trims from either side of a variable.
      http://www.w3schools.com/php/func_string_trim.asp

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.