RE: Code to send user info to database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michelle,

You said you've tried tutorial after tutorial. What specific problems are
you having? What kind of database are you using? Have you architected the db
yet? We can't help much if we don't know what specific problems you're
having (e.g. db connection problems, PHP parse errors, unexpected results,
etc., etc.).

Rich

> -----Original Message-----
> From: Michelle Whelan [mailto:webmaster@dirtjobs.com]
> Sent: Friday, February 28, 2003 2:09 PM
> To: php-db@lists.php.net
> Subject:  Code to send user info to database
> 
> 
> 
> Hi all, 
> 
> I'm just starting out with writing PHP and would like to get 
> help with writing the code for my forms to have the data sent 
> to a database.  Here is one of my forms:
> 
> <?php
> if ($submit == "Submit"){ 
>   echo "Your listing has been submitted"; 
>   echo "Go back <a href="Homewww.dirtjobs.com/index.php>Home</a>";
>   echo "<a href="Add">www.dirtjobs.com/havedirt.php>Add 
> another listing</a>";
> } 
> else{ 
>   echo ' 
> 
> <form method="post" action=".php" name="">
> 
> <table width="100%">
> <tr><td><img src="images/xhavedirt.gif" width="191" height="40"></td>
> </tr>
> 
> <tr><td><&nbsp;</td></tr>
> 
> <tr><td><font face="Arial, Helvetica, sans-serif, Verdana" 
> size="2" color="#FFFFFF"><b>WHAT TYPE OF DIRT?</font>
>   
> <SELECT NAME="needdirtype">
> <option value="clean">CLEAN DIRT FOR FINISH GRADING
> <option value="minus">DIRT WITH 6" MINUS ROCKS
> <option value="rocks">DIRT WITH ROCKS
> </SELECT></td>
> </tr>
> 
>  
> <tr><td><font face="Arial, Helvetica, sans-serif, Verdana" 
> size="2" color="#FFFFFF"><b>APPROXIMATE QUANTITY OF DIRT IN YARDS:
> <input type="text" size="7" maxlength="7" 
> name="noyards">Yards</font></td>
> </tr>
> 
> <tr><td><&nbsp;</td></tr>
> 
> <tr><td><font face="Arial, Helvetica, sans-serif, Verdana" 
> size="2" color="red"><b><u><i>*MANDATORY*</font></b></i></u></td>
> </tr>
> 
> <tr><td><font face="Arial, Helvetica, sans-serif, Verdana" 
> size="2" color="#FFFFFF"><b>CONTACT NAME:</b></font>
> <input type="text" size="25" maxlength="25" name="contactname"></td>
> </tr>
>  
> <tr><td><font face="Arial, Helvetica, sans-serif, Verdana" 
> size="2" color="#FFFFFF"><b>CONTACT PHONE NUMBER:</b>
> <input type="text" size="3" maxlength="3" name="areacode"> 
> <input type="text" size="3" maxlength="3" name="prefix"> 
> <tr><td><font face="Arial, Helvetica, sans-serif, Verdana" 
> size="2" color="#FFFFFF"> - <input type="text" size=4" 
> maxlength="4" name="suffix"></td>
> </font></tr>
> 
> <tr><td><font face="Arial, Helvetica, sans-serif, Verdana" 
> size="2" color="#FFFFFF"><b>ZIP CODE:</b>
> <input type="text" size="5" maxlength="5" name="zip code">
> <br>
> <i>(Jobs are sorted by zip code to find other jobs in the 
> area)</i></font></td>
> </tr>
> 
> <tr><td><font face="Arial, Helvetica, sans-serif, Verdana" 
> size="2" color="#FFFFFF"><b>JOB EXPIRATION DATE:</b></font> 
> <input type="text" size="12" maxlength="12" name="expdate">
> <br>
> <i>(If no date is listed, jobs will be removed in 60 
> days.)</i></font></td>
> </tr>
> 
> <tr><td>&nbsp;</td></tr>
> 
> <tr><td><font face="Arial, Helvetica, sans-serif, Verdana" 
> size="2" color="blue"><b>(*Optional)</b>/font></td>
> </tr>
> 
> <tr><td><font face="Arial, Helvetica, sans-serif, Verdana" 
> size="2" color="#FFFFFF"><b>EMAIL ADDRESS:</b></font>
> <input type="text" size="30" maxlength="30" name="email"></td>
> </tr>
> 
> <tr><td><font face="Arial, Helvetica, sans-serif, Verdana" 
> size="2" color="#FFFFFF"><b>CITY OF JOB LOCATION:</b></font>
> <input type="text" size="30" maxlength="30" name="jobcity"></td>
> </tr>
> 
> <tr><td><font face="Arial, Helvetica, sans-serif, Verdana" 
> size="2" color="#FFFFFF"><b>JOB CROSS STREETS:</b></font>
> <input type="text" size="58" maxlength="58" name="xstreets"></td>
> </tr>
>  
> <tr><td><font face="Arial, Helvetica, sans-serif, Verdana" 
> size="2" color="#FFFFFF"><b>JOB EXPIRATION DATE:</b>
> <input type="text" size="12" maxlength="12" name="exp.date">
> <br>
> <i>(If no date is listed, jobs will be removed in 60 
> days.)</i></font></td>
> </tr>
> 
> <tr><td>&nbsp;</td></tr>
> 
> <tr><td><center><input type="submit" name="submit" 
> value="Submit"></input>&nbsp
> <input type="reset" name="reset" value="Clear"></input></center></td>
> </tr>
> </table>
> 
> I imagine the code is probably somewhat simple, but I have 
> read tutorial after tutorial etc. and am getting nowhere for 
> the past two weeks.  
> 
> This is also the first time I have ever posted to a mailing 
> list so I apologize if my request is incorrect in format.  
> 
> Thanks so much, 
> 
> Michelle 
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux