Can anybody please help me in writing this very simple script:

This script will allow visitors on my site to order my services.

The price will depend on the following factors:

a) Number of pages
b) Delivery time in days
c) Format of the delivered files.

After they select they will be directed to paypal to pay the amount.

Thanks, Regards.

9 Years
Discussion Span
Last Post by pete911

Hi, not sure what you want, because you haven't said much.
But from what I understand you should create html form, where user will choose some options. form attribute action will be
action="<?php echc $_SERVER; ?>" which means that form will be submitted to the same page. Action attribute will be post - action="post". Then you can chceck at the beginning of the file if user submitted values you expect. For example:

//check if form with your desired value has been submitted
if (isset($_POST['numpages'])) {
    //check if there is data you want
    //some people can use telnet to post unwanted data
    if (preg_match('^/[\d]{1,2}/$',$_POST['numpages']) {
        $numpages = $_POST['numpages'];
    } else {
        Header("Location: ".$_SERVER['PHP_SELF']);

(I haven't tested this code, it's just ilustration),
then you check if all values ($numpages, ...) are set, if yes
then you submit it to paypal.
If you want to use paypal express checkout, download my code from here:

hopefuly it helps

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.