1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Quick PHP question, someone please help me out! Thanks!

Discussion in 'PHP' started by antpalm8, Nov 8, 2010.

  1. #1
    I have searched the forum and can't find an exact answer to my question...

    So I am using wordpress and I want to have a user enter information into a form. Then, on the next page, I want to take one of their entries and multiply in by .7 and display in on the screen.
    SEMrush
    My question is...

    1. What is the best way to pass the information from the form to the next page?
    2. How do I take that number and multiply it by .7 and display it on the screen?

    Thank you in advance.

    -Anthony
     
    antpalm8, Nov 8, 2010 IP
    SEMrush
  2. xpertdev

    xpertdev Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    just the post the form data and action of the form must be the second page where you want the data of that for.
    Let me know if anything is not clear.
     
    xpertdev, Nov 10, 2010 IP
  3. DN48

    DN48 Peon

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The best way to pass the information from the form to the next page is the POST method or you can use sessions
     
    DN48, Nov 11, 2010 IP
  4. jdjaded

    jdjaded Peon

    Messages:
    123
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yes, you can use either the GET or POST methods. POST is probably better. add a method attribute to your form tag:

    <form (other stuff) method="POST" action="yoursite.com/pagetosendto">
    (each of the form elements below this, such as text fields, etc. will have their own name. this is important)
    </form>

    then in the php script on "pagetosendto", you just do:

    $your_variable = $_REQUEST('form element name');

    and use that variable however you want.
     
    jdjaded, Nov 11, 2010 IP