Jump to content

candleman98

New Members
  • Posts

    4
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.webscopedesigns.com/

Profile Information

  • Gender
    Male
  • Location
    Allentown, PA

candleman98's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Your right in that books and tutorials I have used are years old. I will look into current materials and recode. Thanks for your input.
  2. Hello, I created a simple form to capture info entered into textboxes. It is posted to a php script to write to a mysql database. The script connects to the database without error, but the only thing that gets entered into the database is the date that is declared on the php script page and the autoincrment id. The form can be found at http://www.lvoaf.org/reg.html Here is some code snippets: <h1>New Member Sign Up</h1> <form id="form1" name="form1" method="post" action="reg_members_php.php"> --------------------------------------------- php script <html> <head> <title>LVOAF Registration Form</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body background="images/hg_background.jpg" text="#000000"> <?php $host = 'localhost'; $user = 'correct'; $pass = 'password'; $myDB = 'lvoaforg_register'; // Connection to DB is either sucessful or dies $connect = mysql_connect($host, $user, $pass) or die ("Could not connect to the server\n"); //insert string for first table $today = date('M d Y'); $table_name = 'member_reg'; //create query string to insert data into table $query = "INSERT INTO $table_name (today, fname, lname, address, city, state, zip, phone, email, year_grad, school_grad, played) VALUES ('$today', '$fname', '$lname', '$address', '$city', '$state', '$zip', '$phone', '$email', '$year_grad', '$school_grad', '$played')"; ?> <table width="80%" align="center"> <tr> <td height="233" valign="top" bgcolor="#003399"> <p><img src="images/logo_med.jpg" width="750" height="250"></p> </td> </tr> <tr> <td valign="top" bgcolor="#0099FF"> <p><br> <br> <?php //Print statement to verify if connection and inserts were made mysql_select_db($myDB); if (mysql_query($query, $connect)){ print "Hello!!! $fname, your registration for Bethany's 2010 VBS High Seas Adventure was successful on $today!<br>"; print "We'll be seeing you at Bethany July 12th - 16th!!!<br><br>"; print "Thank you!!!<br><br>"; print "Darcy Bierer - Director of Children's Ministries"; } else { print " $fname, your registration request failed to register!"; } mysql_close ($connect); ?> </p> </td> </tr> <tr> <td valign="top" bgcolor="#0099FF"> <p> </p> <p>Form Data Entered On: <?php //Print last name back to screen print ("$today"); ?> </p> <p>First Name: <?php //Print last name back to screen print ("$fname"); ?> </p> <p>Last Name: <?php //Print last name back to screen print ("$lname"); ?> </p> <p>Address: <?php //Print last name back to screen print ("$address"); ?> </p> <p>City: <?php //Print last name back to screen print ("$city"); ?> </p> <p>State: <?php //Print last name back to screen print ("$state"); ?> </p> <p>Zip: <?php //Print last name back to screen print ("$zip"); ?> </p> <p> </p> <p> </p> <p> </p></td> </tr> </table> </body> </html>
  3. haku, Thanks for sending me down this road.... I changed my former .ssi file into a footer_php.php file. Then I removed the .ssi include that was in the index page, and replaced it with <?php require ("footer_php.php"); ?></p> Lastly I saved the index page as index.php and now I am getting both things I wanted.... a include footer file at the bottom of all my pages that I can modify dozens of pages in one site by just modifying the footer_php.php file, and secondly the year 2008 is not hard coded but is being pulled by the sever through this code: <? echo date("Y"); ?> As displayed here.... 2008 is not hard coded - http://www.webscopedesigns.com/index_php.php Thanks for the direction... {{{Candleman}}}
  4. Instead of changing footer files at the bottom of my web pages every year, I created a server side include file that would be placed at the bottom of my web pages, which requires pages to be saved as .shtml files. I also have code that will pull the year fom the sever, so I no longer hard code "copyright 2008" part of the code. My problem is how can I include both php code to pull the sever year, and a ssi file on the same page, when a page with php requires me to save the page as php and .ssi requires me to save the page as .shtml? I have code that works for both the .ssi file and the php code to get the server to display the year, but I can't get them to do it on the same page. Any suggetions? Thanks! {{{Candleman}}}
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.