Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////Code in Webpage http://www.recruitingblt.comli.com/add-new-sales-record.html
- <div id="regcon">
- <FORM NAME = "reg" action="database.php">
- <div style="width:150px; float:left; display:inline-block; font-family: Verdana;
- font-size: 12px; padding-left:13px;"> Enter Client Name: </div>
- <input type="text" id="textbox" name="regnum" size="30"/>
- <input name="Submit" type="submit" value="Get Form"/>
- </form>
- </div>
- ////////////////////Code in database.php
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>Database test</title>
- </head>
- <?php
- //This checks if the regnum is set or not, if it is, we use it and search DB, but if it is not, we just skip it and show the plain, empty jotform instead.
- if(isset($_GET['regnum']) && $_GET['regnum'] !== '')
- {
- $regnum = $_GET['regnum'];
- $db_host = 'mysql6.000webhost.com';
- $db_username = 'a8748341_blt';
- $db_password = '********';
- $db_name = 'a8748341_bltrec';
- mysql_connect( $db_host, $db_username, $db_password) or die(mysql_error());
- mysql_select_db($db_name);
- // Check for the registration number which is a feild REG in the database - These should be unique
- $result = mysql_query("SELECT * FROM bltrecruiting WHERE Client_Name='$regnum'") or die(mysql_error());
- $row = mysql_fetch_array( $result );
- if (empty($row[Client_Name]))
- {
- echo "No previous record of Client: $regnum <br>";
- echo "Please try again <br>" ?>
- <div id=regcon>
- <FORM NAME = "reg" action=database.php>
- <div style=width:150px; float:left; display:inline-block; font-family: Verdana;
- font-size: 12px; padding-left:13px;> Client Name: </div>
- <input type="text" id="textbox" name="regnum" size="20"/>
- <input name="Submit" type="submit" value="Get Form"/>
- </form>
- </div>
- <?php
- }
- else
- {
- // Get the fields from the database
- $address = $row['Client_Address'];
- $phonenumber = $row['Client_Phone'];
- $name= $row['Attn_Name1'];
- //add your additional fields here
- //You can replace this section to match yours, the important part is the if at the start
- $params = 'clientName=1&address[addr_line1]=2&address[addr_line2]=3&address[city]=4&address[state]=5&address[postal]=6&invoiceName1=7&email15=8&name216=9&email2=10';
- echo '<iframe id="43438603456356" frameborder="0" scrolling="no" style="width: 100%; border: medium none; height: 1118px;" name="43438603456356" allowtransparency="true" src="http://www.jotformeu.com/form/43438603456356?<?php echo $params; ?>"></iframe>';
- }
- }
- else
- {
- echo '<iframe id="43438603456356" frameborder="0" scrolling="no" style="width: 100%; border: medium none; height: 1118px;" name="43438603456356" allowtransparency="true" src="http://www.jotformeu.com/form/43438603456356"></iframe>';
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement