PDA

View Full Version : For any of you php guru's out there...



jasonhardwick
September 7th, 2006, 09:44 AM
For any of you php guru's out there... I have a bit of a delema. I have a php display page that displays my companies interested clients, We qualify them by address so we are using a third party form to do this is ther any way to set up my display page to include the form already filled out so all we have to do is hit go to get the results? Below is my php code as well as the form information

I know my form is very basic....


<?php
// Make a MySQL Connection
mysql_connect("xxx", "xxx", "xxx") or die(mysql_error());
mysql_select_db("xxx") or die(mysql_error());
// Get all the data from the "example" table
$result = mysql_query("SELECT * FROM Invitation_Request")
or die(mysql_error());

// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<br>\n";
echo "<B>ID: </B>", $row['ID_Number'];
echo "<br>\n";
echo "<B>Type: </B>", $row['Type'];
echo "<br>\n";
echo "<B>First Name: </B>", $row['First_Name'];
echo "<br>\n";
echo "<B>Last Name: </B>", $row['Last_Name'];
echo "<br>\n";
echo "<B>Company: </B>", $row['Company'];
echo "<br>\n";
echo "<B>Address: </B>", $row['Address'];
echo "<br>\n";
echo "<B>City: </B>", $row['City'];
echo "<br>\n";
echo "<B>State: </B>", $row['State'];
echo "<br>\n";
echo "<B>Zip: </B>", $row['Zip'];
echo "<br>\n";
echo "<B>Country: </B>", $row['Country'];
echo "<br>\n";
echo "<B>Phone: </B>", $row['Phone'];
echo "<br>\n";
echo "<B>E-Mail: </B>", $row['Email'];
echo "<br>\n";
echo "<B>Ports of Interest: </B>", $row['Ports_of_Interest'];
echo "<br>\n";
echo "<B>Collector Level: </B>", $row['Collector_Level'];
echo "<br>\n";
echo "<B>Collector Type: </B>", $row['Collector_Type'];
echo "<br>\n";
echo "<B>Designer Specialty: </B>", $row['Designer_Specialty'];
echo "<br>\n";
echo "<B>Designer Preferences: </B>", $row['Designer_Preferences'];
echo "<br>\n";
echo "<B>Designer Visit with Client: </B>", $row['Designer_Visit_with_Client'];
echo "<br>\n";
echo "<B>Designer Preview: </B>", $row['Designer_Preview'];
echo "<br>\n";
echo "<B>Designer Name to Dealers: </B>", $row['Designer_Name_to_Dealers'];
echo "<br>\n";
echo "<B>Consultant Specialty: </B>", $row['Consultant_Specialty'];
echo "<br>\n";
echo "<B>Consultant Type: </B>", $row['Consultant_Type'];
echo "<br>\n";
echo "<B>Dealer Type: </B>", $row['Dealer_Type'];
echo "<br>\n";
echo "<B>Dealer Fairs: </B>", $row['Dealer_Fairs'];
echo "<br>\n";
echo "<B>Dealer Which Ones: </B>", $row['Dealer_Other'];
echo "<br>\n";
echo "<B>Curator Title: </B>", $row['Curator_Title'];
echo "<br>\n";
echo "<B>Press Title: </B>", $row['Press_Title'];
echo "<br>\n";
echo "<B>Press Media Type: </B>", $row['Press_Media_Type'];
echo "<br>\n";
echo "<B>Gallery Specialty: </B>", $row['Gallery_Specialty'];
echo "<br>\n";
echo "<B>Gallery Handle: </B>", $row['Gallery_Handle'];
echo "<br>\n";
echo "<B>Gallery Fairs: </B>", $row['Gallery_Fairs'];
echo "<br>\n";
echo "<B>Gallery Which Ones: </B>", $row['Gallery_Other'];
echo "<br>\n";
echo "<B>Artist Affiliation: </B>", $row['Artist_Affiliation'];
echo "<br>\n";
echo "<B>Date: </B>", $row['Date'];
echo "<br><hr>\n";
}
echo "</table>";
?>







<div id="width">
<div id="minwidth">
<div id="container">
<div id="banner">
<div id="logo"></div>
</div>
<div id="content" class="clearfix" accesskey="2">
<div id="home">
<form method="post" action="http://www.Zillow.com/Home,$search$SearchBar.formSearchBar.sdirect" name="formSearchBar" id="formSearchBar">
<div style="display:none;">
<input type="hidden" name="formids" value="inputAddrStrtHood,If,inputCityStateZip,If_0,If_1,I f_2,If_3,applySearchFilter"/>
<input type="hidden" name="submitmode" value=""/>
<input type="hidden" name="submitname" value=""/>
<input type="hidden" name="If" value="F"/>
<input type="hidden" name="If_0" value="F"/>
<input type="hidden" name="If_1" value="T"/>
<input type="hidden" name="If_2" value="T"/>
<input type="hidden" name="If_3" value="F"/>
<input type="hidden" name="applySearchFilter" id="applySearchFilter" value="F"/>
</div>
<div id="inlinesearch">
<h1>&nbsp;</h1>
<fieldset id="basic">
<legend>Value Any Home</legend>
<div class="first">
<label for="inputAddrStrtHood"><span><strong><br />
Address</strong> OR <strong>Street</strong> OR <strong>Neighborhood</strong></span></label>
<br />
<input type="text" name="inputAddrStrtHood" value="" id="inputAddrStrtHood" tabindex="1" maxlength="100" accesskey="4"/>
<br />
</div>
<div>
<label for="inputCityStateZip"><span><strong><br />
City, State</strong> OR <strong>ZIP</strong></span></label>
<br />
<input type="text" name="inputCityStateZip" value="" id="inputCityStateZip" tabindex="2" maxlength="100"/>
<br />
<br />
<input name="image" type="image" class="go" tabindex="3" src="http://www.zillow.com/static/images/btn_go.gif" alt="Go"/>
</div>
</fieldset>
</div>
</form>
<div id="zestdisclaimer">
<p>&nbsp;</p>
</div>
</div>
</div>
</div>
</div>
</div>

bwh2
September 7th, 2006, 09:47 AM
just use the value tags. example:


<input type="text" name="inputCityStateZip" value="<?php echo $row['zip']; ?>" id="inputCityStateZip" tabindex="2" maxlength="100"/>

jasonhardwick
September 7th, 2006, 09:59 AM
Ok... is there a way to include the form in the php code so that each aplicant will have there own form?

bwh2
September 7th, 2006, 10:04 AM
yes, put your html table within your php while statement.

jasonhardwick
September 7th, 2006, 10:21 AM
I did that and It gives me this error

Parse error: syntax error, unexpected T_STRING in /usr/home/web/users/a0027892/html/admin/00396554200.09_Display_Invitation_Request_All.php on line 47

Here is my While statement.

while($row = mysql_fetch_array( $result )<div id="width">
<div id="minwidth">
<div id="container">
<div id="banner">
<div id="logo"></div>
</div>
<div id="content" class="clearfix" accesskey="2">
<div id="home">
<form method="post" action="http://www.Zillow.com/Home,$search$SearchBar.formSearchBar.sdirect" name="formSearchBar" id="formSearchBar">
<div style="display:none;">
<input type="hidden" name="formids" value="inputAddrStrtHood,If,inputCityStateZip,If_0,If_1,I f_2,If_3,applySearchFilter"/>
<input type="hidden" name="submitmode" value=""/>
<input type="hidden" name="submitname" value=""/>
<input type="hidden" name="If" value="F"/>
<input type="hidden" name="If_0" value="F"/>
<input type="hidden" name="If_1" value="T"/>
<input type="hidden" name="If_2" value="T"/>
<input type="hidden" name="If_3" value="F"/>
<input type="hidden" name="applySearchFilter" id="applySearchFilter" value="F"/>
</div>
<div id="inlinesearch">
<h1>&nbsp;</h1>
<fieldset id="basic">
<legend>Value Any Home</legend>
<div class="first">
<label for="inputAddrStrtHood"><span><strong><br />
Address</strong> OR <strong>Street</strong> OR <strong>Neighborhood</strong></span></label>
<br />
<input type="text" name="inputAddrStrtHood" value="<?php echo $row['Address']; ?>" id="inputAddrStrtHood" tabindex="1" maxlength="100" accesskey="4"/>
<br />
</div>
<div>
<label for="inputCityStateZip"><span><strong><br />
City, State</strong> OR <strong>ZIP</strong></span></label>
<br />
<input type="text" name="inputCityStateZip" value="<?php echo $row['zip']; ?>" id="inputCityStateZip" tabindex="2" maxlength="100"/>
<br />
<br />
<input name="image" type="image" class="go" tabindex="3" src="http://www.zillow.com/static/images/btn_go.gif" alt="Go"/>
</div>
</fieldset>
</div>
</form>
<div id="zestdisclaimer">
<p>&nbsp;</p>
</div>
</div>
</div>
</div>
</div>
</div>) {

jasonhardwick
September 7th, 2006, 10:24 AM
By the way I really appreciate the help

bwh2
September 7th, 2006, 10:32 AM
without typing all of the code, it's going to be more like this:

<?php
// Make a MySQL Connection
mysql_connect("xxx", "xxx", "xxx") or die(mysql_error());
mysql_select_db("xxx") or die(mysql_error());
// Get all the data from the "example" table
$result = mysql_query("SELECT * FROM Invitation_Request")
or die(mysql_error());

// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// the php while is still running for the below html
?>
<!-- here goes your html form code -->
<input type="text" name="inputCityStateZip" value="<?php echo $row['zip']; ?>" id="inputCityStateZip" tabindex="2" maxlength="100"/>
<!-- end the html and go back to php -->
<?php
} // end the while
?>

jasonhardwick
September 7th, 2006, 11:36 AM
Thanks for the help:pleased:

bwh2
September 7th, 2006, 11:36 AM
no problem. let me know if you can't get that going.