Jump to content

nomadrw

Members
  • Posts

    20
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

nomadrw's Achievements

Member

Member (2/5)

0

Reputation

  1. Greetings everyone: I'm new to HTML5 and CSS3 and I can not figure out why my Navigation is not working. Note I have a link for Motelakura (H1 tag) and when you place the cursor over it the Hand does not shop up unless you have it on the top part of the wording. Did that make any sense. If you need all the css coding please let me know. Any help would be great. Thanks in advance. <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" /> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> </head> <body onload="MM_preloadImages('buttons/home_over.jpg','buttons/about_us_over.jpg','buttons/directions_over.jpg','buttons/contact_us_over.jpg','buttons/things_to_over.jpg')"> <!-- header-wrap --> <div id="header-wrap"> <header> <hgroup> <h1><a href="index.html">Motelakura</a></h1> <h3>Hours: 24 hours a day, seven days a week </h3> </hgroup> <nav> <ul> <li><img src="buttons/ends.jpg" width="60" height="36" /></li> <li><a href="index.html"><img src="buttons/home.jpg" alt="Home Page" name="home" width="126" height="36" border="0" id="home" onMouseOver="MM_swapImage('home','','buttons/home_over.jpg',1);MM_swapImgRestore()" /></a></li> <li><a href="about_us.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('about_us','','buttons/about_us_over.jpg',1)"><img src="buttons/about_us.jpg" alt="About Us" name="about_us" width="126" height="36" border="0" id="about_us" /></a></li> <li><a href="directions.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('directions','','buttons/directions_over.jpg',1)"><img src="buttons/directions.jpg" alt="Directions to" name="directions" width="126" height="36" border="0" id="directions" /></a></li> <li><a href="contact_us.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact us','','buttons/contact_us_over.jpg',1)"><img src="buttons/contact_us.jpg" alt="Contact Us" name="contact us" width="126" height="36" border="0" id="contact us" /></a></li> <li><a href="attractions.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Things_to_do','','buttons/things_to_over.jpg',1)"><img src="buttons/things_to.jpg" alt="Thing to do in LA county" name="Things_to_do" width="126" height="36" border="0" id="Things_to_do" /></a></li> <li><img src="buttons/ends.jpg" width="60" height="36" /></li> </ul> </nav> </header></div> here is the css3 /* ------------------------------------------------------ STRUCTURE --------------------------------------------------------- */ #header-wrap { width: 100%; height: 70px; z-index: 99999; /* position: fixed;*/ top: 0; left: 0; } header { position: relative; width: 900px; height: 70px; margin: 0 auto; } /* ------------------------------------------- Header -------------------------------------------- */ /* Logo */ header hgroup { position: absolute; background: url(../images/header.jpg) no-repeat; height: 142px; width: 307px; display: block; top: 18px; left: 2px; } header hgroup h1 a { margin-top: 40px; margin-left: 5px; margin-bttom: 15px; /*text-indent: -9999em;*/ display: block; height: 45px; width: 300px; } header hgroup h3 { margin-top: 25px; /* text-indent: -9999em;*/ height: 14px; font-size: 12px; } /* Main Navigation */ header nav { float: left; margin-top: 155px; } header nav ul { width: 900px; padding: 0; list-style: none; } header nav ul li { float: left; }
  2. Greetings: I'm using DreamWeaver CS4 to create a HTML5 template and I'm not sure how to create the template. The older templates HTM3, 4 you made a template with Editable Regions and saved it with a template name (ie bytestemplate) You then create your web pages and inserted the template into the pages. The template if you need to make any changes you could do so and all the pages within the template would change. Question can HTML5 do this with the Article tag or with some other tag or do I use the editable Regions within the Article tag. Hope that made sense. Any Help would be great. Thanks damon
  3. I'm trying to figure out how to make a template objects (like you would in HTML3) where you can set up readable regions. Reason for this is I have a 12 page website it that shows my work, ie my reel, graphic.... You would have your 1. header wrapper section ( ie log and menu area) 2. this is where I would want a readable regions 3. have another readable region 4 then have your footer wrapper section Here is my html 5 <body> <!-- header-wrap --> <div id="header-wrap"> <header> <!-- <hgroup> <h1><a href="index.html"></a></h1> </hgroup> --> <nav> <ul> <li><a href="#main">Home</a></li> <li><a href="#services">Graphics</a></li> <li><a href="#portfolio">Web</a></li> <li><a href="#about-us">My Reel</a></li> <li><a href="#styles">Media</a></li> <li><a href="#styles">Bio</a></li> <li><a href="#contact">Contact Info</a></li> <li><a href="#styles">Links</a></li> </ul> </nav> </header></div> <!--logo and information --> <!-- header-wrap --> <div id="logo-wrap"> <logo> <lgroup> <h1><a href="index.html"> </a></h1> <h3>Welcome to my website</h3> </lgroup> <nav> <ul> <li>Phone: 714-504-8895 • </li> <li>e-mail: <a href="#mailto:www.damonwongdesign@yahoo.com">damonwongdesign</a></li></ul> </nav> </logo></div> ///---this is where i want to place the readable regions--// ///--this is where I would like to have the footer wrapper---/// </body> </html> This is part of the ccs3 code /* ------------------------------------------------------ STRUCTURE --------------------------------------------------------- */ #header-wrap { width: 100%; height: 45px; z-index: 99999; position: fixed; top: 0; left: 0; } header { position: relative; width: 940px; height: 45px; margin: 0 auto; } /*new information*/ logo-wrap { width: 100%; height: 65px; /* z-index: 99999; */ position: fixed; top: 65px; left: 0; } logo { position: relative; width: 940px; height: 65px; margin: 0 auto; } /*end of new information*/ /* ------------------------------------------- Header -------------------------------------------- */ /*header hgroup { position: absolute; background: url(../images/xxxxdesign.gif) no-repeat; height: 61px; width: 340px; display: block; top: 10px; left: 0; */ } header hgroup h1 a { text-indent: -9999em; display: block; height: 31px; width: 130px; } header hgroup h3 { text-indent: -9999em; height: 0; } /* Main Navigation */ header nav { float: right; margin-top: 25px; } header nav ul { font: bold 12px/25px Helvetica, Arial, Sans-serif; margin-right: -5px; padding: 0; list-style: none; } header nav ul li { float: left; } header nav ul a:link, header nav ul a:visited { color: #c5c4c4; margin-right: 20px; text-shadow: 0 -1px 0 rgba(10, 10, 10, 1); } header nav ul a:hover, header nav ul a:active { color: #17a231 } /*new information ie logo and contact info*/ /* Logo */ logo lgroup { position: absolute; background: url(../images/xxxx.gif) no-repeat; height: 61px; width: 340px; display: block; top: 45px; /*controls height*/ left: 0; } logo lgroup h1 a { text-indent: -9999em; display: block; height: 65px; width: 340px; } logo lgroup h3 { text-indent: -9999em; height: 0; } /* Main Navigation */ logo nav { float: right; margin-top: 60px; /*controls height*/ } logo nav ul { font: bold 12px/25px Helvetica, Arial, Sans-serif; margin-right: -5px; padding: 0; list-style: none; } logo nav ul li { float: left; } logo nav ul a:link, header nav ul a:visited { color: #000000; margin-right: 20px; text-shadow: 0 -1px 0 rgba(10, 10, 10, 1); } logo nav ul a:hover, logo nav ul a:active { color: #17a231 } /*end of new information*/ Any help would be great. Thanks Damon
  4. I need some help resolving this error message. Error creating new session DEBUG MODE SQL Error : 1016 Can't open file: 'phpbb_sessions.MYI'. (errno: 145) INSERT INTO phpbb_sessions (session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in, session_admin) VALUES ('7bf0803fdfeec21dce30aca0b8d78271', -1, 1283310527, 1283310527, '42f5c529', 7, 0, 0) Line : 187 File : sessions.php Thanks Damon
  5. nomadrw

    XML Gallery help

    Hello everyone: I need a little help here in adding a two other text fields for an xml Gallery. Here is the flash action Script var myGalleryXML = new XML(); myGalleryXML.ignoreWhite = true; myGalleryXML.load("fine_arts.xml"); myGalleryXML.onLoad = function() { _root.gallery_x = myGalleryXML.firstChild.attributes.gallery_x; _root.gallery_y = myGalleryXML.firstChild.attributes.gallery_y; _root.gallery_width = myGalleryXML.firstChild.attributes.gallery_width; _root.gallery_height = myGalleryXML.firstChild.attributes.gallery_height; _root.myImages = myGalleryXML.firstChild.childNodes; _root.myImagesTotal = myImages.length; _root.thumb_height = myGalleryXML.firstChild.attributes.thumb_height; _root.thumb_width = myGalleryXML.firstChild.attributes.thumb_width; _root.full_x = myGalleryXML.firstChild.attributes.full_x; _root.full_y = myGalleryXML.firstChild.attributes.full_y; callThumbs(); createMask(); scrolling(); }; function callThumbs() { _root.createEmptyMovieClip("container_mc",_root.removeMovieClip()); _root.createEmptyMovieClip("container_mc",_root.getNextHighestDepth()); container_mc._x = _root.gallery_x; container_mc._y = _root.gallery_y; var clipLoader = new MovieClipLoader(); var preloader = new Object(); clipLoader.addListener(preloader); for (i=0; i<_root.myImagesTotal; i++) { thumbURL = myImages[i].attributes.thumb_url; myThumb_mc = container_mc.createEmptyMovieClip(i, container_mc.getNextHighestDepth() ); myThumb_mc._y = _root.thumb_height*i; clipLoader.removeMovieClip(container_mc); clipLoader.loadClip("buildings/3rd/"+thumbURL,myThumb_mc); fullPreloader.onLoadStart = function(target) { target.createTextField("my_txt",target.getNextHighestDepth(),0,0,200,20); target.my_txt.selectable = false; }; preloader.onLoadProgress = function(target, loadedBytes, totalBytes) { target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100); }; preloader.onLoadComplete=function(target){ new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true); target.my_txt.removeTextField(); target.onRelease=function(){ callFullImage(this._name); } target.onRollOver=function(){ this._alpha=50; }; target.onRollOut=function(){ this._alpha=100; }; } } } function callFullImage(myNumber) { myURL = myImages[myNumber].attributes.full_url; myTitle = myImages[myNumber].attributes.title; _root.createEmptyMovieClip("fullImage_mc",_root.getNextHighestDepth()); fullImage_mc._x = _root.full_x; fullImage_mc._y = _root.full_y; var fullClipLoader = new MovieClipLoader(); var fullPreloader = new Object(); fullClipLoader.addListener(fullPreloader); fullPreloader.onLoadStart = function(target) { target.createTextField("my_txt",target.getNextHighestDepth(),0,295,200,20); target.my_txt.selectable = false; }; fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) { target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100); }; fullPreloader.onLoadComplete = function(target) { new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true); target.my_txt.text = myTitle; }; fullClipLoader.loadClip("buildings/"+myURL,fullImage_mc); } function createMask() { _root.createEmptyMovieClip("mask_mc",_root.getNextHighestDepth()); mask_mc._x = _root.gallery_x; mask_mc._y = _root.gallery_y; mask_mc.beginFill(0x000000,100); mask_mc.lineTo(_root.gallery_width,0); mask_mc.lineTo(_root.gallery_width,_root.gallery_height); mask_mc.lineTo(0,_root.gallery_height); mask_mc.lineTo(0,0); container_mc.setMask(mask_mc); } function scrolling() { _root.onEnterFrame = function() { if (mask_mc._ymouse<(mask_mc._height*(1/3)) || mask_mc._ymouse>(mask_mc._height*(2/3))) { container_mc._y += Math.cos(((mask_mc._ymouse)/mask_mc._height)*Math.PI)*15; if (container_mc._y>mask_mc._y) { container_mc._y = mask_mc._y; } if (container_mc._y<(mask_mc._y-(container_mc._height-mask_mc._height))) { container_mc._y = mask_mc._y-(container_mc._height-mask_mc._height); } } }; } import mx.transitions.Tween; import mx.transitions.easing.*; Here is the XML code <gallery thumb_width="120" thumb_height="120" gallery_width="120" gallery_height="400" gallery_x="50" gallery_y="125" full_x="220" full_y="125"> <image thumb_url="balboa_sm.jpg" full_url="balboa.jpg" title="balboa.jpg" subtitle2="Mansonite" subtitle3="$400.00"/> <image thumb_url="surf_sm.jpg" full_url="surf.jpg" title="balboa.jpg" subtitle2="Mansonite" subtitle3="$400.00"/> </gallery> What I want is the photo then the title below it then the subtitle below that and then the subtitle below that. Any Help would be great thanks damon
  6. not sure but try if ($check2 == 0) { to if ($check2 == 1) {
  7. I would first start off small only have 3 tables. When you figure how to make it work. I think you need to add an ID field to your tables, an a master id as well. will look something like this. table one id int not null primary auto increment, date_added datetime, date_modified datetine, f_name varchar (75), l_name varchar (75), and soon table 2 id int not null primary auto increment, id_master int not null date_added datetime, date_modified datetine, username varchar (75), password varchar (75), and soon table 3 id int not null primary auto increment, id_master int not null date_added datetime, date_modified datetine, kid_fname varchar (75), kid_lname varchar (75), and soon in the php you will need to figure out how to connect the table using the id_master field. //get mater_id for use with other tables $master_id = good luck
  8. Hello Everyone: I'm trying to figure out why I not getting a display for my code and why the info is not going to the db. This code is based on a Book called "PHP, MYSQL and Apache" By C Meloni. I modified a little. The db and user has full grant privileges. <?php if (($_POST[op] != "add") || ($_GET[master_id] != "")) { //haven't seen the form, so show it $display_block = " <h1>Add an Entry</h1> <form method=\"post\" action=\"$_SERVER[php_SELF]\">"; if ($_GET[master_id] != "") { //connect to database $conn = mysql_connect("localhost", "nomad", "nomad") or die(mysql_error()); mysql_select_db("teamvelo",$conn) or die(mysql_error()); //get first, last names for display/tests validity $get_names = "select concat_ws(' ', f_name, l_name) as display_name from master_name where id = $_GET[master_id]"; $get_names_res = mysql_query($get_names) or die(mysql_error()); if (mysql_num_rows($get_names_res) == 1) { $display_name = mysql_result($get_names_res,0,'display_name'); } } if ($display_name != "") { $display_block .= "<P>Adding information for <strong>$display_name</strong>:</p>"; } else { $display_block .= " <P><strong>First/Last Names:</strong><br> <input type=\"text\" name=\"f_name\" size=30 maxlength=75> <input type=\"text\" name=\"l_name\" size=30 maxlength=75>"; } $display_block .= "<P><strong>Address:</strong><br> <input type=\"text\" name=\"address\" size=30> <P><strong>City/State/Zip:</strong><br> <input type=\"text\" name=\"city\" size=30 maxlength=50> <input type=\"text\" name=\"state\" size=5 maxlength=2> <input type=\"text\" name=\"zipcode\" size=10 maxlength=10> <P><strong>Telephone Number:</strong><br> <input type=\"text\" name=\"tel_number\" size=30 maxlength=25> <P><strong>Cell Number:</strong><br> <input type=\"text\" name=\"cell_number\" size=30 maxlength=25> <P><strong>Email Address:</strong><br> <input type=\"text\" name=\"email\" size=30 maxlength=150> <P><strong>Emergency Name:</strong><br> <input type=\"text\" name=\"contact_name\" size=30 maxlength=75> <P><strong>Emergency Phone:</strong><br> <input type=\"text\" name=\"contact_phone\" size=25 maxlength=25> <p><input type=\"submit\" name=\"submit\" value=\"Add Entry\"></p> </FORM>"; } else if ($_POST[op] == "add") { //time to add to tables, so check for required fields if ((($_POST[f_name] == "") || ($_POST[l_name] == "")) && ($_POST[master_id] == "")) { header("Location: addentry2.php"); exit; } //connect to database $conn = mysql_connect("localhost", "nomad", "nomad") or die(mysql_error()); mysql_select_db("teamvelo",$conn) or die(mysql_error()); if ($_POST[master_id] == "") { //add to master_name table $add_master = "insert into master_name values ('', now(), now(), '$_POST[f_name]', '$_POST[l_name]')"; mysql_query($add_master) or die(mysql_error()); //get master_id for use with other tables $master_id = mysql_insert_id(); } else { $master_id = $_POST[master_id]; } if (($_POST[address]) || ($_POST[city]) || ($_POST[state]) || ($_POST[zipcode])) { //something relevant, so add to address table $add_address = "replace into address values ('', $master_id, now(), now(), '$_POST[address]', '$_POST[city]', '$_POST[state]', '$_POST[zipcode]')"; mysql_query($add_address) or die(mysql_error()); } if ($_POST[tel_number]) { //something relevant, so add to telephone table $add_tel = "replace into telephone values ('', $master_id, now(), now(), '$_POST[tel_number]')"; mysql_query($add_tel) or die(mysql_error()); } if ($_POST[cell_number]) { //something relevant, so add to fax table $add_cell = "replace into cell values ('', $master_id, now(), now(), '$_POST[cell_number]')"; mysql_query($add_cell) or die(mysql_error()); } if ($_POST[email]) { //something relevant, so add to email table $add_email = "replace into email values ('', $master_id, now(), now(), '$_POST[email]')"; mysql_query($add_email) or die(mysql_error()); } if ($_POST[emergency]) { //something relevant, so add to notes table $add_emergency = "replace into emergency values ('', $master_id, now(), now(), '$_POST[contact_name]', '$_POST[contact_phone]')"; mysql_query($add_emergency) or die(mysql_error()); } $display_block = "<h1>Entry Added</h1> <P>Your entry has been added. Would you like to <a href=\"addentry2.php\">add another</a>?</p>"; } ?> <HTML> <HEAD> <TITLE>Add an Entry</TITLE> </HEAD> <BODY> <?php echo $display_block; ?> </BODY> </HTML> Here is my db and tables CREATE TABLE `teamvelo`.`master_name` ( `id` INT NOT NULL AUTO_INCREMENT , `date_added` DATETIME NOT NULL , `date_modified` DATETIME NOT NULL , `f_name` VARCHAR( 75 ) NOT NULL , `l_name` VARCHAR( 75 ) NOT NULL , PRIMARY KEY ( `id` ) ) ENGINE = MYISAM ; CREATE TABLE `teamvelo`.`address` ( `id` INT NOT NULL AUTO_INCREMENT , `user_id` MEDIUMINT( 11 ) NOT NULL , `date_added` DATETIME NOT NULL , `date_modified` DATETIME NOT NULL , `address` VARCHAR( 255 ) NOT NULL , `city` VARCHAR( 50 ) NOT NULL , `state` CHAR( 2 ) NOT NULL , `zipcode` VARCHAR( 10 ) NOT NULL , `enum` ENUM( 'home', 'work', 'other' ) NOT NULL , PRIMARY KEY ( `id` ) CREATE TABLE `teamvelo`.`telephone` ( `id` INT NOT NULL AUTO_INCREMENT , `master_id` MEDIUMINT( 11 ) NOT NULL , `date_added` DATETIME NOT NULL , `date_modified` DATETIME NOT NULL , `tel_number` VARCHAR( 25 ) NOT NULL , `type` ENUM( 'home', 'work', 'other' ) NOT NULL , PRIMARY KEY ( `id` ) ) ENGINE = MYISAM ; CREATE TABLE `teamvelo`.`cell` ( `id` INT NOT NULL AUTO_INCREMENT , `master_id` MEDIUMINT( 11 ) NOT NULL , `date_added` DATETIME NOT NULL , `date_modified` DATETIME NOT NULL , `cell_number` VARCHAR( 25 ) NOT NULL , `type` ENUM( 'home', 'work', 'other' ) NOT NULL , PRIMARY KEY ( `id` ) ) ENGINE = MYISAM ; Any help would be great. Damon PS I trying to learn PHP
  9. Yes you have a permission problem, go into the admin on the host site and change it. Please note every time you open this script you will over write your file.cvs.
  10. Hello Everyone: I'm trying to do a book exercise and I'm getting this error message Warning: include(/home/password.inc) [function.include]: failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/testing/10/ch22/logentry.php on line 3 Warning: include() [function.include]: Failed opening '/home/password.inc' for inclusion (include_path='.:/Applications/xampp/xamppfiles/lib/php:/Applications/xampp/xamppfiles/lib/php/pear') in /Applications/XAMPP/xamppfiles/htdocs/testing/10/ch22/logentry.php on line 3 I have full grant permission on the db and there are a couple entries in the fields. If you need to see the db please let me know. Below is the codes login.php <HTML> <HEAD> <TITLE>Weblog login screen</TITLE> </HEAD> <P><B>Supply a username and password.</B></P> <FORM METHOD=POST ACTION="logentry.php"> <P>USERNAME:<INPUT TYPE=TEXT NAME="test_username" SIZE=20></P> <P>PASSWORD:<INPUT TYPE=PASSWORD NAME="test_password" SIZE=20></P> <P>BLOG ENTRY:<BR><TEXTAREA NAME="logtext" COLS=75 ROWS=20 WRAP="VIRTUAL"></TEXTAREA></P> <P><INPUT TYPE="SUBMIT" VALUE="SUBMIT"> </FORM> </BODY> </HTML> login.php <?php $date = date("Ymd"); include("/home/password.inc"); if($_POST['test_username'] == $username && $_POST['test_password'] == $password) { $fp = fopen("/entries/$date.txt", "w"); $try_entry = fwrite($fp, $_POST['logtext']); if ($try_entry > -1) { print("Weblog entry for $date written to disk."); } elseif ($try_entry == -1) { print("Weblog entry write failed."); } } else { mail("me@localhost", "Weblog snoop alert", "Someone from $REMOTE_ADDR is trying to get into your weblog entry handler."); } ?> password.inc I have this file in a directory called home <?php $username = "nomad"; $password = "nomad"; ?> For the entries directory I had a file called 20091208.txt Any help would be great Damon
  11. OK I figured it out and boy do I feel like a big dummy. I physically entered the data instead of writing a SQL in which the password was not encrypted. So I will remember that one. damon
  12. Hello Everyone: I have some troubles on a simple coding. I'm getting a redirect when I enter a password and user name. The password and User name is valid. Project is on a test server on a Mac using XMAPP Here is the codeing: Userlogin.html <html> <head> <title>User Login Form</title> </head> <body> <H1>Login Form</H1> <FORM METHOD="POST" ACTION="userlogin.php"> <P><STRONG>Username:</STRONG><BR> <INPUT TYPE="text" NAME="username"></p> <P><STRONG>Password:</STRONG><BR> <INPUT TYPE="password" NAME="password"></p> <P><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Login"></P> </FORM> </body> </html> userlogin.php <?php //check for required fields from the form if ((!$_POST[username]) || (!$_POST[password])) { header("Location: userlogin.html"); exit; } //connect to server and select database $conn = mysql_connect("localhost", "nomad", "nomad") or die(mysql_error()); mysql_select_db("allysonart",$conn) or die(mysql_error()); //create and issue the query $sql = "select f_name from auth_users where username = '$_POST[username]' AND password = password('$_POST[password]')"; $result = mysql_query($sql,$conn) or die(mysql_error()); //get the number of rows in the result set; should be 1 if a match if (mysql_num_rows($result) == 1) { //if authorized, get the values of f_name l_name $f_name = mysql_result($result, 0, 'f_name'); //set authorization cookie setcookie("auth", "1", 0, "/", "www.allysonjonesmurals.com", 0); //create display string $display_block = "<P>$f_name $l_name is authorized!</p> <P>Authorized Users' Menu: <ul> <li><a href=\"secretpage.php\">secret page</a> </ul>"; } else { //redirect back to login form if not authorized header("Location: userlogin.html"); exit; } ?> <HTML> <HEAD> <TITLE>User Login</TITLE> </HEAD> <BODY> <? echo "$display_block"; ?> </BODY> </HTML> secretpage.php <?php if ($_COOKIE[auth] == "1") { $display_block = "<p>You are an authorized user.</p>"; } else { //redirect back to login form if not authorized header("Location: allyson_show.htm"); exit; } ?> <html> <head> <title>Secret Page</title> </head> <body> <?php echo "$display_block"; ?> </body> </html> DB information db name is allysonart table auth_users id int not null primary key auto_increment f_name varchar (50) l_name varchar (50) email varchar (150) username varchar (50) password varchar (50) all the files are in the same folder Any help would be great. Thanks in advance Please not this is not a class assignment. damon
  13. it should like like this slsContents[0] = "<img src=photos\"ip2803-017.jpg" width="512px" height="384px">" damon
  14. I'm looking for a good PHP book for beginner to intermediate. I recently purchased one called PHP Bible 2nd Edition from Tim Converse and it's not that great. It has errors and the book does not tell you how to make the db's need for the exercises. I think the only good this this book is for references. Thanks in advance Damon
  15. I do this inside the phpmyadmin? If so How do i create the tables with the query. that I have listed above or should I just create the SQL inside phpmyadmin. thanks damon
×
×
  • 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.