Jump to content

bananababe

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Contact Methods

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

Profile Information

  • Gender
    Female
  • Location
    chicago

bananababe's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. you might be able to use javascript to determine which font a user has and grab a different style sheet depending on which one it is. Personally, I stick with the reliable 5 or so fonts that everyone has for body copy and if I want a specialized one for headers or other uses, I save it out as an image. You can use the <h1> tag to surround an image, just use the 'title=""' attribute with the img tag for SEO.
  2. z-index only works with absolute positioning. You could use absolute or relative positioning and then top/left to move one of your divs. Please post your code or link to your problem.
  3. you can't use alt with <option>. even if it worked, you wouldn't get a mouseover because that's not how it works with the <img> tag, unless your browser preferences were set up to show the alts. You are trying to have rollover effects on a dropdown list?
  4. I just tried to validate with w3c css validator and there are problems with your styles - there is no css style called "align:left". Use "text-align: left;" your div.forhometext has a colon instead of a semi-colon. there are others as well. Download the web developers toolbar for firefox and go to tools > validate css and it will line item any errors.
  5. huh! thanks. my php code in the doc is surrounded by <?php ..... ?> but there are instances where it switches back to html and then uses the short tag when resuming php. Is the short tag enabled an option you code in php or is it a browser preference? thanks very much!!
  6. thank you very much wildteen88! I am just getting into php - can you please tell me what a short_open_tag enabled means? I see you escaped the quotes with the backslash. FYI - I still got one error with your adjusted echo xml declaration and I figured out it was the extra ";" after \"UTF-8\"; bdmovies – wildteen88's fix solved my IE page layout problem
  7. If I include the doctype, this is what the browser displays: "Parse error: syntax error, unexpected T_STRING in /home4/allenski/public_html/guestbook.php on line 1"
  8. I set up a guestbook in php but it of course does work with the html doc type declaration I use for the other html pages since it confuses the browser. So I deleted the xml and doc type but when I try to validate I get lots of errors for this page. Is there a way around this? I read somewhere online that you can use javascript to get around this, but I tried using a <script> document.write(); and that didn't work. I am currently using the transitional doctype in the rest of my pages: <?xml version="1.0" encoding="UTF-8"?> <!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"> I also noticed that when I load the same php page in IE 7/8, the php page is not centered (like the rest of my pages) and some of my other css properties are not being accessed (though not all which is wierd). I've still got the external link to the css file in the header, so I suspect it has to do with the doctype missing, but maybe it is just IE Anyone know how to resolve this?
  9. Do you want the code to be there on page load and is it static? If so, you add copy between the textarea tags as follows: <textarea name="comments" id="comments" cols="44" rows="8"><p><strong>type your code or comments here</strong></p> </textarea> btw - my doc type is <?xml version="1.0" encoding="UTF-8"?> <!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">
  10. The addguestbook.php script was MISSING the variables for the name, email and comment area. the script SHOULD have read as follows: <?php $host="localhost:3306"; // Host name $username="XXXX"; // Mysql username $password="XXXX"; // Mysql password $db_name="allenski_guestbook"; // Database name $tbl_name="guestbook"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect server "); mysql_select_db("$db_name")or die("cannot select DB"); $name=mysql_real_escape_string($_POST['name']); //This value has to be the same as in the HTML form file; this variable initialization was missing $email=mysql_real_escape_string($_POST['email']); //This value has to be the same as in the HTML form file; this variable initialization was missing $comment=mysql_real_escape_string($_POST['comment']); //This value has to be the same as in the HTML form file; this variable initialization was missing $datetime=date("y-m-d h:i:s"); //date time $sql="INSERT INTO $tbl_name(name, email, comment, datetime)VALUES('$name', '$email', '$comment', '$datetime')"; $result=mysql_query($sql); //check if query successful if($result){ echo "Successful"; echo "<BR>"; echo "<a href='viewguestbook.php'>View guestbook</a>"; // link to view guestbook page } else { echo "ERROR"; } mysql_close(); ?>
  11. I'm new to php and I'm trying to complete a class project where I wanted to include a guestbook on the site I created. I am trying to use this script from http://www.phpeasystep.com/phptu/15.html ( apparently the forums there are dead much to my disappointment) which is functioning, EXCEPT that it doesn't seem to be assigning the name, email and comment values to the variables because that info is not saved in the database. Only the id and date/time text areas are populated in the MySQL table and thus not showing up when the view page connects to the database to display each entry. I did not make any changes (I copied and pasted ALL the code) except to put in the correct variable info regarding my host/login/password/database name and table name. Below I xx'd out my username and password for the mysql database so that is not the problem - it is connecting to the database fine, just not assigning the variable information I think. I checked that the id's in the html match the variables. I THINK it is a setting on the table data? anyone got any ideas? I'd appreciate it very much. Here's what I've got: This is the php code I used to create the table in the MySQL database: CREATE TABLE `guestbook` ( `id` int(4) NOT NULL auto_increment, `name` varchar(65) NOT NULL default '', `email` varchar(65) NOT NULL default '', `comment` longtext NOT NULL, `datetime` varchar(65) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; guestbook.php page: www.allenskillicorn.com/beta/phptests/guestbook.php <table width="400" border="0" align="center" cellpadding="3" cellspacing="0"> <tr> <td><strong>Test Sign Guestbook </strong></td> </tr> </table> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form id="form1" name="form1" method="post" action="addguestbook.php"> <td> <table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td width="117">Name</td> <td width="14">:</td> <td width="357"><input name="name" type="text" id="name" size="40" /></td> </tr> <tr> <td>Email</td> <td>:</td> <td><input name="email" type="text" id="email" size="40" /></td> </tr> <tr> <td valign="top">Comment</td> <td valign="top">:</td> <td><textarea name="comment" cols="40" rows="3" id="comment"></textarea></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Submit" /> <input type="reset" name="Submit2" value="Reset" /></td> </tr> </table> </td> </form> </tr> </table> <table width="400" border="0" align="center" cellpadding="3" cellspacing="0"> <tr> <td><strong><a href="viewguestbook.php">View Guestbook</a> </strong></td> </tr> </table> viewguestbook.php page: www.allenskillicorn.com/beta/phptests/viewguestbook.php <table width="400" border="0" align="center" cellpadding="3" cellspacing="0"> <tr> <td><strong>View Guestbook | <a href="guestbook.php">Sign Guestbook</a> </strong></td> </tr> </table> <br> <?php $host="localhost:3306"; // Host name $username="XXXX"; // Mysql username $password="XXXX"; // Mysql password $db_name="allenski_guestbook"; // Database name $tbl_name="guestbook"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect server "); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ ?> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td><table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td>ID</td> <td>:</td> <td><? echo $rows['id']; ?></td> </tr> <tr> <td width="117">Name</td> <td width="14">:</td> <td width="357"><? echo $rows['name']; ?></td> </tr> <tr> <td>Email</td> <td>:</td> <td><? echo $rows['email']; ?></td> </tr> <tr> <td valign="top">Comment</td> <td valign="top">:</td> <td><? echo $rows['comment']; ?></td> </tr> <tr> <td valign="top">Date/Time </td> <td valign="top">:</td> <td><? echo $rows['datetime']; ?></td> </tr> </table></td> </tr> </table> <BR> <? } mysql_close(); //close database ?> viewguestbook.php page: www.allenskillicorn.com/beta/phptests/viewguestbook.php <table width="400" border="0" align="center" cellpadding="3" cellspacing="0"> <tr> <td><strong>View Guestbook | <a href="guestbook.php">Sign Guestbook</a> </strong></td> </tr> </table> <br> <?php $host="localhost:3306"; // Host name $username="XXXX"; // Mysql username $password="XXXX"; // Mysql password $db_name="allenski_guestbook"; // Database name $tbl_name="guestbook"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect server "); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ ?> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td><table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td>ID</td> <td>:</td> <td><? echo $rows['id']; ?></td> </tr> <tr> <td width="117">Name</td> <td width="14">:</td> <td width="357"><? echo $rows['name']; ?></td> </tr> <tr> <td>Email</td> <td>:</td> <td><? echo $rows['email']; ?></td> </tr> <tr> <td valign="top">Comment</td> <td valign="top">:</td> <td><? echo $rows['comment']; ?></td> </tr> <tr> <td valign="top">Date/Time </td> <td valign="top">:</td> <td><? echo $rows['datetime']; ?></td> </tr> </table></td> </tr> </table> <BR> <? } mysql_close(); //close database ?>
×
×
  • 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.