Jump to content

Hooch

Members
  • Posts

    452
  • Joined

  • Last visited

Everything posted by Hooch

  1. Hooch

    PHP NUKE

    hey man, goto a nuke forum.Try nukeresources.com and sign up for thier forums.When making a post just enter [***]http://linktoimage.com/image.jpg[/***]Change both ***'s to img.With the newer versions of Nuke, the built-in wysiwyg editor is crap, you will need to dissable it. You will find the info at the above link I mentioned. Good luck,Hooch
  2. Hooch

    database layout

    I just came to this problem ThePsion5. I made a database and had the entry page made. Then I realized, how will I delete the car from the site lineup. So if I do it your way (ty very much) I can just edit the existing DB with a field for onsite or not. Then just display from the table where the value is 1 within "onsite".Thanks guys.
  3. Hooch

    database layout

    I'm not completely understanding what you mean, but before I ask any more questions, would this need to be done after everycar has left the site? If so, it's too much, I need to make this very simple. Since 10 other people rotate through this job. And trust me..it would get missed.
  4. Hooch

    database layout

    I made the table a little confusing. car_id would be a normal numerical value. But in the top part of my original post, (#2) Car ID is the actual numbers on the car. It would just be a text entry. Thanks reportingsjr, I'll give it a go.
  5. Hooch

    database layout

    Hey all. I want to make one of my jobs at work easier. I have to keep track ofrailcars we have on site. We can have up to 220 cars here at one time. With about 800 -> 900 cars in the fleet. I want to keep track of: 1. Date -- June 1 2006 (VARCHAR) 2. Car ID -- ie xxx2300 (VARCHAR) 3. Area -- Area Name (TEXT) 4. Commodity -- H2O2 (VARCHAR) 5. Inbound -- 0 or 1 (INT) 6 Outbound -- 0 or 1 (INT) 7. Full -- 0 or 1 (INT) 8. Empty -- 0 or 1 (INT)Are my values correct? What I want the database to do is keep track of what is onsiteat any given time. So when a car leaves it is taken out of the DB. (I think I can get that part done with PHP.) My question is would I just need 1 table here? I'm asking because I wonder if someone with better knowledge would know of a more efficient way to makethe DB. Also, I think adding the car_id (INT AUTO_INCREMENT) field would be smart,but my here's other question. Say a railcar leave the site -id 325- This leaves a blank for that id. Can the db somehow be restructered automatically so it fills that id with the old 326 id? Then ofcourse the rest above 326 would drop down 1. Thank you Hooch
  6. Hooch

    Auto links

    Awsome thanks guys. This gives me ideas for other things. PHP is amazing to say the least.Installed an working like a charm. Thanks a bunch!!
  7. Hooch

    Auto links

    Hi everyone. I have a question for the guru's here. I want to make a link that can tell what month it is, then have it direct the user to that month's webpage. The webpage has 12 months of activities, and it would be nice to have the home pagewith one "events" link that will direct you to the present month webpage. Can this be done without a database too? Thank you..Hooch
  8. Hooch

    mmmm cookies

    I want to stop having to log in everytime I go back to this page.This page is an admin type page where I click links to set up other parts.Once the part is set up, I then go back to this original admin page.But everytime I go back I have to log in. Any thing I have tried has brought me errors.
  9. Hooch

    mmmm cookies

    Hey all. I'm trying to add a cookie session to my script. For my cookie I will use: setcookie('panelname', 'admin', time()+36000); This is setting $panelname to admin (I think anyway)Here in my existing code I have a login script. (on the page I want to get in to)If I log in with the set username and pass It is successfull.But everytime I go back I have to log in. I'm having alot of trouble finding out where I put the setcookie. <?php//add the databaseinclude 'db.php'; // Define your username and password$panelname = "admin";$password = "pass";if ($_POST['txtUsername'] != $panelname || $_POST['txtPassword'] != $password) {?><h1>Login</h1><form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <br /><label for="txtUsername" class="main">Username:</label><br /><input type="text" title="Enter your Username" name="txtUsername" class="txtbox" /><br /><label for="txtpassword" class="main">Password:</label><br /><input type="password" title="Enter your password" name="txtPassword" class="txtbox" /><br /><input type="submit" name="Submit" value="Login" /></form><?php } else {?> <table>WEBPAGE HERE</table><?php }mysql_close();?> I hope I am clear enough. Thank you, Hooch
  10. Hooch

    php - xml

    ok great thank you. I'll update my progress once I get a change to try it out.*** I have the playlist.php producing the same info the playlist.xml does Thanks guy!! Now for some reason the mp3 player does not want to work still. I'll have to ask some actionscript guru's. Maybe something needs changing there.*** WOOHOO!! It would not work from my existing browser. Once I tried from a new browser, it worked perfect!! Thank you justsomeguy your time and effort has helped me to a tee again.
  11. Hooch

    php - xml

    Thanks guy, it's making sense now. I'm at work, so I cannot try this out, but should my new code be... <?php header ("content-type: text/xml"); print "<?xml version=\"1.0\"?>\n"; mysql_connect("localhost", "*****", "****") or die ("<b>Unable to establish connection with MySQL.</b>\n"); mysql_select_db("****") or die ("<b>Unable to locate specified database.</b>"); $query = "SELECT * FROM music ORDER BY track_id ASC"; $result = mysql_query($query); print "<music>\n";while($songs = mysql_fetch_object($result)) { print "<songs>\n";print "<song name=\"".$songs->name."\" band=\"".$songs->band."\" File=\"".$songs->File."\" />\n";print "</songs>\n"; } print "</music>";?> Thanks again for your help lad!!
  12. Hooch

    php - xml

    FYI This code works.. print "<songs>\n"; print "<song>".$songs->song."</song>\n"; print "<artist>".$songs->artist."</artist>\n";print "<mp3>".$songs->mp3."</mp3>"; print "</songs>\n"; But because of childNodes in my actionscript I need them all to be on one line. I followed a tut for the actionscript and I havent' grasped the nodes yet to edit that instead.
  13. Hooch

    php - xml

    Hey man, thanks. Tha't what need's to be displayed. Thank you. But a new error is now up.. The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. --------------------------------------------------------------------------------Only one top level element is allowed in an XML document. Error processing resource 'http://www.@@@.com<songs>-^ hmm..??
  14. Hooch

    php - xml

    I was hoping someone could look at my php code here. I need the following line of code to be in one line (due to childNodes in actionscript) print "<song name=".$songs->name." band=".$songs->band." File=".$songs->File." />\n"; Here's the whole code.. <?php header ("content-type: text/xml"); print "<?xml version=\"1.0\"?>\n"; mysql_connect("localhost", "*****", "****") or die ("<b>Unable to establish connection with MySQL.</b>\n"); mysql_select_db("****") or die ("<b>Unable to locate specified database.</b>"); $query = "SELECT * FROM music ORDER BY track_id ASC"; $result = mysql_query($query); while($songs = mysql_fetch_object($result)) { print "<songs>\n";print "<song name=".$songs->name." band=".$songs->band." File=".$songs->File." />\n";print "</songs>\n"; } ?> But it comes up with an error. Anyone see what's wrong?? The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. --------------------------------------------------------------------------------A string literal was expected, but no opening quote character was found. Error processing resource 'http://www.@@@@.c/s...<song name=song01 band=band01 File=music/song01.mp3 />-----------^ Thanks for taking the time to look and help. Hooch
  15. Hooch

    asp compared to php

    Is asp worth learning? Or should I stick to learning php? What are the beneifits of asp over php if any?Thanks..Mike
  16. Hooch

    Databases

    Man, you are a very generous person. Thank you so much for helping me. It works great. Have a great weekend (what's left) Hooch
  17. Hooch

    Databases

    Linky Have a boo
  18. Hooch

    Databases

    I finally got to spend a little more time here. This script you made is missing 1 part. My spot for the pics. <td width="228" align="center" valign="middle"> <div align="left"><img src="http://www.tiarts.org/images/mem/bg.jpg" name="main" id="main" style="height:200px;width:150px;" /></div></td> It's the middle part of the table Or am I missing something? << probably the problem. Thanks..Hooch
  19. Hooch

    Databases

    Thank you again. So as new names are entered..how will they fill up?**nvm..I got it. looking good!!
  20. Hooch

    Databases

    Holy cow...I can't figure another one out. 1st take a look at my original page I made without any database. This is the website (my 1st official) I am about to complete. TIArts.org I have everything done from html. This is good for now..to get them up and running. But I want to get them running a database that each member you see there can upload/upgrade their info themselves...then the pages will automatically change accordingly. Well, as good as can possibly be to my knowledge. (thank you w3schools!!) All was going pretty good till this page. Here's my code that needs a tweak. <?php######################################################################## Copyright (c) 2006 TIArts.org# Coded by # http://.com#######################################################################include '../includes/header-members.php';// This will display by order of lastname then the rest just fills ininclude '../includes/db.php';$result = mysql_query("SELECT * FROM users ORDER BY lastname ASC");while ($r = mysql_fetch_assoc($result)){?><link href="../includes/tia.css" rel="stylesheet" type="text/css" /><table width="700" height="10"align="center"border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="center"></div></td> </tr></table><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" width="700" height="300" align="center"> <TR VALIGN="top" ALIGN="left"> <td width="125" height="225" rowspan="2" align="left" valign="top"><?php include '../includes/links-members.php'; ?></td> <td width="153" align="center" valign="middle"> <div align="left"> <a href="profile.php?u=<? echo $r[id]; ?>"title=<? echo $r[medium]; ?> onmouseover="main.src='../images/mem/<? echo $r[id]; ?>a.jpg'"onmouseout="main.src='../images/mem/bg.jpg'" class="footer2"><? echo $r[firstname]; ?><? echo " "; echo $r[lastname]; ?></a> </div> </td> <td width="228" align="center" valign="middle"> <div align="left"><img src="../images/mem/bg.jpg" name="main" id="main" style="height:200px;width:150px;" /></div></td> <td width="194" align="center" valign="middle"> <div align="left"> <a href="profile.php?u=<? echo $r[id]; ?>"title=<? echo $r[medium]; ?> onmouseover="main.src='../images/mem/<? echo $r[id]; ?>a.jpg'"onmouseout="main.src='../images/mem/bg.jpg'" class="footer2"><? echo $r[firstname]; ?><? echo " "; echo $r[lastname]; ?></a> </div> </td></TR></TABLE><?phpinclude '../includes/footer.php'; } mysql_close(); ?> The problem with that code is thw whole page is duplicated for each member.Here's the RESULT I tried changing the whole page to php (alot of echo's) and it ended up with the same result. ...please help. Thank you very much..Hooch
  21. Hooch

    Databases

    I had to go this way. Thanks again ladd!! <a href="<? echo "$r[website]"; ?>">WEBSITE</a><br> <a href="mailto:<? echo "$r[email]"; ?>">EMAIL</a><br /><br />
  22. Hooch

    Databases

    I still need to work on how I do the tours part. I think I'll just do a radio button style entry. There are 3 different tours. So each tour would have a yes or no entry. Then I would need 3 fields for tours. Thank you guy!! I'll giver er a shot when I get home tonight.
  23. Hooch

    Databases

    Hello all. I hope this is in the correct spot to ask a database question. I do want to use php to extract the info. The database is almost complete to my specs. I was hoping to display all my info from the database. Most of that I have done. It looks exactlythe way I want it. But I cannot find how to get a cpl things done. Here's what I'm hoping to do. 1. retrieve a website and email and make them clickable. 2. In my db below I have 2 entries = 2 people. Is it possible to call upeach person's lastname and have them displayed in a table alphabetically? Also I would need to display members in each tour they are involved. -- -- Table structure for table `users`-- CREATE TABLE `users` ( `id` int(11) NOT NULL auto_increment, `username` varchar(32) NOT NULL default '', `password` varchar(32) NOT NULL default '', `firstname` varchar(32) NOT NULL default '', `lastname` varchar(32) NOT NULL default '', `email` varchar(32) NOT NULL default '', `medium` varchar(32) NOT NULL default '', `studio` varchar(32) NOT NULL default '', `tours` varchar(32) NOT NULL default '', `website` varchar(32) default NULL, `address` varchar(32) NOT NULL default '', `city` varchar(32) NOT NULL default '', `province` varchar(32) NOT NULL default '', `zip` varchar(7) NOT NULL default '', `phone` varchar(13) default NULL, `biography` text NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`), UNIQUE KEY `email` (`email`)) TYPE=InnoDB AUTO_INCREMENT=3;-- -- Dumping data for table `users`-- INSERT INTO `users` VALUES (1, 'USERNAME here', 'MD5PASSWORD', '1st name', 'lastname', 'email here', 'Painter', 'Studio name, 'tours involved', 'website', 'address, phone', 'BIO info goes here');INSERT INTO `users` VALUES (2, 'USERNAME here', 'MD5PASSWORD, '1st name', 'lastname', 'email here', 'Painter', 'Studio name, 'tours involved', 'website', 'address, phone', 'BIO info goes here'); Again thank you in advance..Hooch
  24. Hooch

    Log in

    Thank guys. I am a little confused with your very detailed answer guy. But it's late and I have been sitting at the computer for a few hours now. Maybe a fresh brain will prevail tomorrow. Have a good one....Hooch
  25. Hooch

    Log in

    I really need to buy someone a drink now. I have a new request.When a user successfully registers I have them automatically redirected to the index.php page. Thing is, they are not logged in when they get there. Is this easy to show how to impliment? Many many thanks..HoochP.S. here is my index.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>my test site</title></head><body><?php include 'header.php'; ?><table width="700" border="2" align="center" cellpadding="0" cellspacing="0" bordercolor="#BE8647"> <tr> <td width="161" rowspan="2"> <div align="center"> <?php // Connect to the database include "includes/db.php";$query = "SELECT COUNT(ip) AS numrows FROM stats WHERE ip='".$_SERVER["REMOTE_ADDR"]."'";$result = mysql_query($query) or die('Error, query failed');$row = mysql_fetch_array($result);$numrows = $row['numrows'];if ($numrows == 0) {mysql_query("INSERT INTO stats(ip,hits,activity,user_agent)VALUES ('".$_SERVER["REMOTE_ADDR"]."','1',now(),'{$_SERVER['HTTP_USER_AGENT']}')");}else{mysql_query("UPDATE stats SET hits=hits+1 WHERE ip='".$_SERVER['REMOTE_ADDR']."'");}$result = mysql_query("SELECT COUNT(ip) AS numrows FROM stats");$row = mysql_fetch_array($result);$unique = $row['numrows'];$result = mysql_query("SELECT hits FROM stats");while ($row = mysql_fetch_array($result)) {$hits += $row['hits'];} $msgbox = ""; if (!$_COOKIE['id']){ echo"member info block<br>"; echo "<form action=\"login.php\" method=\"post\">name: <input type=\"text\" name=\"username\" size=\"8\"><br> password: <input type=\"password\" name=\"password\" size=\"8\"> <input type=\"image\" class=\"submit\" name=\"submit\"></form>"; } else { echo"member info block<br>"; $msgbox .= "Welcome - "; // Get users information $result = mysql_query("SELECT * FROM users WHERE id='".mysql_escape_string($_COOKIE['id'])."'"); $r=mysql_fetch_assoc($result); $msgbox .= $r["username"]; } echo $msgbox; ?> <form method="GET" action="search.php"> <b>Search:</b> <input type="text" name="search" size="10" /> <input type="image" class="submit" value="Search!" /> </form> <a href="signup.html">Register</a><br /> <a href="includes/logout.php">Logout</a><br /><br /> <strong>SITE STATS</strong><br /> Unique Hits: <? echo $unique; ?><br /> Hits: <? echo $hits; ?> </div> </td> <td width="296"> </td> <td width="233"> </td> </tr> <tr> <td>Test middle </td> <td>Test right </td> </tr></table></body></html>
×
×
  • Create New...