p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

beginning_php thread: Newbie Problem (submit my form to DB)

Message #1 by Sri_core@m... on Wed, 1 May 2002 18:16:48
How do I submit my records from a preview page to the access DB. I tried  
odbc connection and able to retreive records from MS access Db. That is 
not my problem. 
This works perfect: 
 $cnx = odbc_connect( 'Test','Admin','' ); 
Now I want to submit the records from my preview.php to the Db. How do I 
do this? my preview.php page is:
<title>This is the Preview of the log page</title>
<p style="BACKGROUND-COLOR: navy"><IMG height=70 src="c:\images\logo.gif" 
<p><strong><em><font size="4">Today is </font></em></strong>
<? print(Date("l F d, Y")); ?></p>
<p align="center"><strong><em><font size="4">The extractor (bgxs)/ mailer 
(bgmm) part of the ebill log</font></em></strong></p>
<p><em><font size="2">This is the Run log you submitted. Please check for 
<form id="newchange" name="newchange" action="../submit.php" method="post">
<table cellSpacing="1" cellPadding="1" border="2"><tr style="BACKGROUND-
COLOR: green">

<td><strong>Bill Run Date</strong></td>
<td><strong>Bill Run By</strong> </td>
<td><strong>Bill Run Number</strong>
<td><strong>Bill Run ID Number</strong>
<td><strong>Splitter Details (bgsp)</strong>
<td><Strong>bgxs Start Time</strong>
<td><Strong>bgxs End Time</strong>
<td><Strong>bgmm Start Time</strong>
<td><Strong>bgmm End Time</strong>
<td><Strong>Number of Emails Sent Successfully</strong>
<td><Strong>Number of Emails Sent UnSuccessfully</strong>
<td><?echo $HTTP_POST_VARS['text1']; ?></td>
<td><?echo $HTTP_POST_VARS['text2']; ?></td>
<td><?echo $HTTP_POST_VARS['text3']; ?></td>
<td><?echo $HTTP_POST_VARS['text4']; ?></td>
<td><?echo $HTTP_POST_VARS['TEXTAREA1']; ?></td>
<td><?echo $HTTP_POST_VARS['text5']; ?></td>
<td><?echo $HTTP_POST_VARS['text6']; ?></td>
<td><?echo $HTTP_POST_VARS['text7']; ?></td>
<td><?echo $HTTP_POST_VARS['text8']; ?></td>
<td><?echo $HTTP_POST_VARS['text9']; ?></td>
<td><?echo $HTTP_POST_VARS['text10']; ?></td>

<p><input type="submit" value="Submit">&nbsp;&nbsp;&nbsp;&nbsp; <input 
type="reset" value="Reset"></p>
$last_modified = filemtime("preview.php");
print("Last Modified ");
print(date("m/j/y h:i", $last_modified));

In ASP I can use something like this: I will build a page called 
submit.asp. Should I do this in php too....? (or) is there a better way to 
do it?

dim sql, rs
sql = "insert into Log (iis_object, db, ServerChangeRequests, Objective, 
DevChangeDate, ProdChangeDate, Developer) values ('"&Request("text1")
call process(sql, rs)

How do I do it in php? 
Any help from you'll will be great.

  Return to Index