Home

Forums

Web development

 

 

 

 
     
 
dna88 Web development and Technology Forum
 
Profile   Register   Memberlist   Usergroups   FAQ   Search  Log in
ASP And PHP Form Page

 
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum
Author Message
hasnatme
Moderator
Moderator


Joined: 22 Aug 2004
Posts: 283
Location: Dhaka,Bangladesh

Post Post subject: ASP And PHP Form Page Reply with quote

Hi Guys,

I have just registered here to join all of you and hope will continue as long as possible.

Now I want to know how can I make a form page like the following link in both asp and php platform.
[http://www.hnass.com/rate_request.asp]

Thanks in advance.
Hasnat Jamil.
_________________
Just Fly With Your Dreams!!!
Digital Vision
Sun Aug 22, 04 9:38 pm
Back to top
hasnatme View user's profile Send private message Yahoo Messenger MSN Messenger
dinangkur
Super Moderator
Super Moderator


Joined: 24 Mar 2004
Posts: 491
Location: Dhaka, Bangladesh

Post Post subject: Reply with quote

Regarding your problem, you've to use databases with your php or asp code. I recommend you to use mySQL. Now php has native facility to connect mySQL. ASP also connect mySQL through ODBC. And if you search on the net through www.google.com then you will find lot free script to do your job.

http://www.phpscript.com/

-DK.
_________________
...we too are stardust...
Sun Aug 22, 04 10:10 pm
Back to top
dinangkur View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
quantum
Site Admin
Site Admin


Joined: 07 Mar 2004
Posts: 1048
Location: Dhaka, Bangladesh

Post Post subject: Making a HTML form Reply with quote

Dear Hasnat,

Welcome to the community.

Now the form page you are looking at does not need either php or asp. You are thinking too complex. The form tag is an HTML attribute. Not asp or php attribute. ASP or PHP comes when you are doing something with the form data. In this case, what they are doing is probabaly having it sent to some email address. Javascript is being used here to validate the form data. This is the form code they used on their site:

Code:
<table border="0" cellpadding="4" style="border-collapse: collapse" bordercolor="#111111" width="65%" id="AutoNumber2">
        <tr>
        <form name="form" method="post" onSubmit="return v(this)">
       
          <td width="100%" colspan="3" height="30" align="center"><b>
          <font face="Verdana" size="2" color="#CC3300">Rate Request</font></b></td>
        </tr>
        <tr>
          <td width="43%"><b><font face="Verdana" size="1">Shipment type</font></b></td>
          <td width="3%"><b><font face="Verdana" size="1">:</font></b></td>
          <td width="55%"><font size="1" face="Verdana"><b>
          <input type="radio" size="20" value="Shipment AIR Type" name="txt_shipment_type">
          <font color="#003366">AIR</font>
          <input type="radio" size="20" value="Shipment SEA Type" name="txt_shipment_type">
          </b></font><b><font face="Verdana" size="1"><font color="#003366">SEA</font>&nbsp; </font></b>
          <font size="1" face="Verdana"><b>
          <input type="radio" size="20" value="Shipment HAZARDOUS Type" name="txt_shipment_type">
          <font color="#003366">Hazardous</font>
          <input type="radio" size="20" value="Shipment REEFER Type" name="txt_shipment_type">
          <font color="#003366">Reefer</font></b></font></td>
        </tr>
        <tr>
          <td width="43%"><b><font face="Verdana" size="1">Shipment term</font></b></td>
          <td width="3%"><b><font face="Verdana" size="1">:</font></b></td>
          <td width="55%"><font size="1" face="Verdana"><b>
          <input type="radio" size="20" value="Shipment PP Term" name="txt_shipment_term">
          <font color="#003366">PP</font>&nbsp;
          <input type="radio" size="20" value="Shipment CC Term" name="txt_shipment_term">
          <font color="#003366">CC</font></b></font></td>
        </tr>
        <tr>
          <td width="43%"><b><font face="Verdana" size="1">Pickup location</font></b></td>
          <td width="3%"><b><font face="Verdana" size="1">:</font></b></td>
          <td width="55%">
            <input type="text" name="txt_pick_location" size="30" style="font-family: Verdana; font-size: 8pt; border-style: ridge; border-width: 1; padding: 0">
          </td>
        </tr>
        <tr>
          <td width="43%"><b><font face="Verdana" size="1">Origin
          Airport/Seaport</font></b></td>
          <td width="3%"><b><font face="Verdana" size="1">:</font></b></td>
          <td width="55%">
            <input type="text" name="txt_origin_airport" size="30" style="font-family: Verdana; font-size: 8pt; border-style: ridge; border-width: 1; padding: 0"></td>
        </tr>
        <tr>
          <td width="43%"><b><font face="Verdana" size="1">Destination
          Airport/Seaport</font></b></td>
          <td width="3%"><b><font face="Verdana" size="1">:</font></b></td>
          <td width="55%">
            <input type="text" name="txt_destination_airport" size="30" style="font-family: Verdana; font-size: 8pt; border-style: ridge; border-width: 1; padding: 0"></td>
        </tr>
        <tr>
          <td width="43%"><b><font face="Verdana" size="1">Place of final
          Delivery</font></b></td>
          <td width="3%"><b><font face="Verdana" size="1">:</font></b></td>
          <td width="55%">
            <input type="text" name="txt_place_final_delivery" size="30" style="font-family: Verdana; font-size: 8pt; border-style: ridge; border-width: 1; padding: 0"></td>
        </tr>
        <tr>
          <td width="43%"><b><font face="Verdana" size="1">No of Packages</font></b></td>
          <td width="3%"><b><font face="Verdana" size="1">:</font></b></td>
          <td width="55%">
            <input type="text" name="txt_no_of_packages" size="30" style="font-family: Verdana; font-size: 8pt; border-style: ridge; border-width: 1; padding: 0"></td>
        </tr>
        <tr>
          <td width="43%"><b><font face="Verdana" size="1">Total Gross weight</font></b></td>
          <td width="3%"><b><font face="Verdana" size="1">:</font></b></td>
          <td width="55%">
            <input type="text" name="txt_total_gross" size="30" style="font-family: Verdana; font-size: 8pt; border-style: ridge; border-width: 1; padding: 0"></td>
        </tr>
        <tr>
          <td width="43%"><b><font face="Verdana" size="1">Dimensions of each
          package/lot</font></b></td>
          <td width="3%"><b><font face="Verdana" size="1">:</font></b></td>
          <td width="55%">
            <input type="text" name="txt_dimensions_each_package" size="30" style="font-family: Verdana; font-size: 8pt; border-style: ridge; border-width: 1; padding: 0"></td>
        </tr>
        <tr>
          <td width="43%"><b><font face="Verdana" size="1">Date of shipment</font></b></td>
          <td width="3%"><b><font face="Verdana" size="1">:</font></b></td>
          <td width="55%">
            <input type="text" name="txt_date_shipment" size="30" style="font-family: Verdana; font-size: 8pt; border-style: ridge; border-width: 1; padding: 0"></td>
        </tr>
        <tr>
          <td width="43%"><b><font face="Verdana" size="1">Instruction, if any</font></b></td>
          <td width="3%"><b><font face="Verdana" size="1">:</font></b></td>
          <td width="55%">
            <input type="text" name="txt_instruction" size="30" style="font-family: Verdana; font-size: 8pt; border-style: ridge; border-width: 1; padding: 0"></td>
        </tr>
        <tr>
          <td width="43%"><b><font face="Verdana" size="1">Contact Person</font></b></td>
          <td width="3%"><b><font face="Verdana" size="1">:</font></b></td>
          <td width="55%">
            <input type="text" name="txt_person" size="30" style="font-family: Verdana; font-size: 8pt; border-style: ridge; border-width: 1; padding: 0"></td>
        </tr>
        <tr>
          <td width="43%"><b><font face="Verdana" size="1">Contact Email</font></b></td>
          <td width="3%"><b><font face="Verdana" size="1">:</font></b></td>
          <td width="55%">
            <input type="text" name="txt_email" size="30" style="font-family: Verdana; font-size: 8pt; border-style: ridge; border-width: 1; padding: 0"></td>
        </tr>
        <tr>
          <td width="43%">&nbsp;</td>
          <td width="3%">&nbsp;</td>
          <td width="55%">
          <input type="submit" value="Submit" name="submit" style="font-family: Verdana; font-size: 8pt; font-weight: bold; border-style: ridge; border-width: 1; padding: 0">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="submit" value="Clear Form" name="reset" style="font-family: Verdana; font-size: 8pt; font-weight: bold; border-style: ridge; border-width: 1; padding: 0"></td>
        </tr>
        <tr>
          <td width="43%">&nbsp;</td>
          <td width="3%">&nbsp;</td>
          <td width="55%">&nbsp;</td>
        </tr>
        </form>

It's done with just four kinds of html form tag. <form>, <input>, <submit>, <reset>

Now tell us what you really want to do with thr form data that are being submitted? If it is enough that the data is simply emailed to you when the user submits, then most probably you won't have to do any php or asp programming. Your host definitely has a script installed that sends the form data to the email address you specify. You just have ask their support or look at their FAQ to know the name of the script. That'll be enough.

If you want to do anything else with the data then let us know and we will tell you how to do that.
_________________

Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
Mon Aug 23, 04 12:29 am
Back to top
quantum View user's profile Send private message Visit poster's website AIM Address
hasnatme
Moderator
Moderator


Joined: 22 Aug 2004
Posts: 283
Location: Dhaka,Bangladesh

Post Post subject: Reply with quote

Thanks both of you guys. When user click on the submitt button then another page appear..which name is mail_send.asp. Then what is that? And how do I confirm that user cannot leave any empty field or invalid e-mail. And how to put action on the submitt button.

Thanks already.
Hasnat Jamil.
_________________
Just Fly With Your Dreams!!!
Digital Vision
Mon Aug 23, 04 9:53 am
Back to top
hasnatme View user's profile Send private message Yahoo Messenger MSN Messenger
quantum
Site Admin
Site Admin


Joined: 07 Mar 2004
Posts: 1048
Location: Dhaka, Bangladesh

Post Post subject: Javascript form validation Reply with quote

In this particular page, the form input is validated with javascript, which resides on the same page in the header part. Javascript is convenient in this case, because javascript is client based and the browser can validate the data fields immediately without having to send the data to the server and have it come back.

//Edit...you can check the javascript code from the View-Source of the page, in the header section.

It is pretty simple and actually you can use it with minimal modification for your purposes too. Note that you can also use PHP or ASP for such validation, but that is not preferable. Because it would take the extra time to send the data to the server.

Now, things would be easier for us if

1. you tell us what you want to do with the data
2. check out if your host already has a form mailer script running and learn how to use that, as I mentioned earlier. Most probably your host already has a script like the mail_send.asp in the cgi bin. In that case all you have to do is point your html form to that script, like this,

<form name="form1" method="post" action="/cgi-sys/formmail.pl">
_________________

Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.


Last edited by quantum on Mon Aug 23, 04 11:19 am; edited 5 times in total
Mon Aug 23, 04 10:50 am
Back to top
quantum View user's profile Send private message Visit poster's website AIM Address
hasnatme
Moderator
Moderator


Joined: 22 Aug 2004
Posts: 283
Location: Dhaka,Bangladesh

Post Post subject: Reply with quote

Thanks quantum...I will let you know when I will build our website. I have just strated the site.....and I have enough experiences on design, animation, presentation making, flash or etc. But have not any good idea about website developement. You can visit our demo site @here"http://www.hnass.com/
work/website/index.htm" just making the interface.

Thanks.
Hasnat Jamil.
_________________
Just Fly With Your Dreams!!!
Digital Vision
Mon Aug 23, 04 11:00 am
Back to top
hasnatme View user's profile Send private message Yahoo Messenger MSN Messenger
redsky
Beginner User
Beginner User


Joined: 01 Aug 2004
Posts: 26

Post Post subject: Reply with quote

hello everybody,
i want to test my form page in my local computer. So i install apache 1.3.13 web server with mysql,php. When i click submit button on my web page, then i see error masseg like this
Code:
"Method Not Allowed
The requested method POST is not allowed for the URL /insertOK.htm."
Am i doing wrong with apache config file or writing code?
Thu Aug 26, 04 7:12 am
Back to top
redsky View user's profile Send private message
quantum
Site Admin
Site Admin


Joined: 07 Mar 2004
Posts: 1048
Location: Dhaka, Bangladesh

Post Post subject: Post form problem. Reply with quote

Hi redsky,

It is happening because you are not allowed to post to an HTML page with a form submit. You can post to .pl or .php file. So try to change the "action=something.php" . And why would you want to post to an HTML file anyway? An html file will not let you do any processing or anything with the data.

On a personal note, we encourage people to start a new thread for each new problem. This allows you maximum visibility. Most people would'nt check out the end of this old thread for the new problem.
_________________

Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
Thu Aug 26, 04 7:44 am
Back to top
quantum View user's profile Send private message Visit poster's website AIM Address
redsky
Beginner User
Beginner User


Joined: 01 Aug 2004
Posts: 26

Post Post subject: Reply with quote

Thanks, i try it on my computer.
You are right. But i think, this is spam and harmful for forum. And there are a lot of new threads. So i do not start a new poll. Thus i post here.
Thu Aug 26, 04 7:53 am
Back to top
redsky View user's profile Send private message
quantum
Site Admin
Site Admin


Joined: 07 Mar 2004
Posts: 1048
Location: Dhaka, Bangladesh

Post Post subject: Reply with quote

Thanks redsky for your concern. But trust me that it is NOT harmful to start new thread if it is a new problem. Instead, new topic makes it more searchable both by google and the forum search. It makes things more categorised. And any respectable forum has thousands of threads. So number of threads is not a problem, so long it discusses a new topic or problem. Gentle smile

A topic is considered spam if someone does not really want solution to a problem but posts a message or topic just to advertise his company or website. We quickly take action against such posts. If we kept all the spams posted so far we would probably had over 3000 posts by now.
_________________

Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
Thu Aug 26, 04 10:30 am
Back to top
quantum View user's profile Send private message Visit poster's website AIM Address
redsky
Beginner User
Beginner User


Joined: 01 Aug 2004
Posts: 26

Post Post subject: Reply with quote

Thanks admin.
Sat Aug 28, 04 6:02 am
Back to top
redsky View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum All times are GMT - 7 Hours
Page 1 of 1

 

Partners and Resources

Bangladesh hosting company

Bangladesh web design

Driven by phpBB © phpBB Group