Jump to content

MinusMyThoughts

Members
  • Posts

    227
  • Joined

  • Last visited

Everything posted by MinusMyThoughts

  1. hey, long time no questions! ...i'm looking for a good reference on using date and time in MySQL to keep track of event entries......i want to store a time, day, month, and year, and display the events in chronological order. when the date passes, i'd like to have that event move to an archive......really, all i need to figure out is how to store and sort by time and date. i found a bunch of references, but none of them really seemed clear. maybe i'm looking in the wrong places......help?...thanks!love,jason
  2. MinusMyThoughts

    CSS Pwnts me

    i don't think you need to put a div inside a div for what you're doing......try making a paragraph class for each div like this:p.divPara { margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; }...then change over to this: <div class="threecolbox_1E87CDBL"> <p class="divPara"> booooo left <br/><br/><br/><br/><br/><br/><br/><br/>gfd </p></div> ...set the div height to auto......hopefully that works for you...love,jason
  3. sounds good. i ended up clearing JPEG, GIF, and PJPEG......and, Lois, Who's The Boss is not a food.love,jason
  4. as in:echo $_FILES['pic']['type'];?i did that and it returned "image/pjpeg"......what does that mean? and what types should i clear? all i was hoping to do was allow GIF and JPEG images to upload......i appreciate any advice!...and, justsomeguy, do people ever buy you flowers or bake you cakes? they should...love,jason
  5. i didn't have any luck with that......for some reason, it doesn't seem to be replacing anything. i think the way my host is set up is funky, though, because str_ireplace() gives me an error as a "call to undefined function."...thanks, though!love,jason
  6. MinusMyThoughts

    CSS Pwnts me

    set your div's height attribute to 'auto' and see what happens. it's been working wonders for me...lovejason
  7. one potential downfall to that script, CStrauss, is that changing the size of an image will do weird things to its quality. while a properly sized image with a weird compression thing going on is definitely a lesser evil than having to remember 15 different image paths for the different sizes, if the size change is extreme, the image can get downright ugly......don't get me wrong, i use a very similar version of this script in my projects and i love it. i figured that the downside to our approach should be brought up, too......i haven't tried that huge script that was posted above, but if it could dynamically take an image and save a corresponding thumbnail, i see that being a huge advantage if you're doing something like a gallery where every image needs to be sized down to the same old 100 wide. saving an independent thumbnail would save loading time, and depending on how the thumbnail is created, could upgrade the quality of your gallery......and this is what i do when i'm bored and waiting for a solution to a problem that has halted my progress. :)love,jason
  8. the only pages i've seen that look like that are redirect pages (which aren't actually waiting for the page to load) and flash pages......i'd be interested to see a non-flash preloader.love,jason
  9. i'm running the code right off w3schools.com for a file upload, and for some reason or another, IE will NOT upload the file......it works fine in FF, so i'm not sure what's going on. i had declared all my $_FILES variables to something easier to remember, so i changed all that back, and i'm still having issues......here's the code i'm working with (the $debug variable is how i was checking what parts of the script were running; later in the script i echo $debug)... $debug = 'No dice.'; $picURL = ''; $pic_tmp = $_FILES['pic']['tmp_name']; $pic = $_FILES['pic']['name']; $pic_size = $_FILES['pic']['size']; $pic_type = $_FILES['pic']['type']; $pic_error = $_FILES['pic']['error']; if (($_FILES['pic']['type'] == "image/gif") || ($_FILES['pic']['type'] == "image/jpeg") && ($_FILES['pic']['size'] < 1024000)) { if ($_FILES['pic']['error'] > 0) { echo 'Error: ' . $_FILES['pic']['error']; } else { move_uploaded_file($_FILES['pic']['tmp_name'], 'images/praisePics/'.$_FILES['pic']['name']) or die("Could not save " . $pic ."!"); list($width, $height) = getimagesize('images/praisePics/'.$_FILES['pic']['name']); $sizeAdjust = 100/$width; $width = $width * $sizeAdjust; $height = $height * $sizeAdjust; $picURL = '<img src="images/praisePics/' . $_FILES['pic']['name'] . '" width="' . $width . '" height="' . $height . '" align="right">'; $debug = 'I am awesome!'; } } ...the only thing i can think of that would possibly be an issue is that the form i'm uploading with also passes several other $_POST variables that i store in a database with $picURL so i can retrieve the entry and attach the right image with it......i developed all of that code in FF, but my client uses IE. when i use IE to create an entry, everything works except the image. all of my database entries go through and can be correctly retrieved. my image just falls of the face of the planet, though, and i'm not sure how to prevent that issue...love,jason
  10. the way that i did it was to explode the article on a new line, like this:$para = explode("\n", $row['article'])...then i just ran this:echo $para[0];...but if you want to create an article excerpt, you might be better off exploding at the space (' ') and echoing the first 30 words. that way, your entries won't be lopsided when articleX has a ten-word first paragraph and articleY has a 100-word first paragraph......i did the latter on a project, and you can see how it looks here......hope that helps!love,jason
  11. after a little alteration, it worked great!...here's what i'm using that is currently working: $pictureURL = $display['praisePic']; $pictureURL = explode("/",$display['praisePic']); str_replace('src="images','src="../images',$pictureURL); $picture = '<img src="../images/'; for($i = 1; $i <= count($pictureURL) - 1; $i++) { $picture .= $pictureURL[$i]; if ( $i < 2 ) { $picture .= '/';} } ...thanks for your help!love,jason
  12. so, i've put all my update pages in a folder called "update" for organizational purposes......now, that's all working fine, except i'm trying to display my database content on my update pages, including the URL of pictures that my user uploads to accompany things like testimonials and article posts......i use a function with the uploading of the image to save a database entry linking to it that looks like this: <img src="images/praisePics/img.jpg"> ...the problem is that when i call that from the "update" folder, i need to use <img src="../images/praisePics/img.jpg"> ...so i had the idea to use explode("/",$pictureURL) to break it into an array that i called $pictureURL that (at least i think) should look like this:$pictureURL[0] = <img src="images$pictureURL[1] = praisePics$pictureURL[2] = img.jpg">...so i'm running str_replace('src="images','src="../images',$pictureURL) to make the changes to the URL......then i'm running the whole thing through this for() loop: $picture = ''; for($i = 0; $i <= count($pictureURL) - 1; $i++) { $picture = $picture . $pictureURL[$i] . '/'; } $picture = $picture . $pictureURL[$i]; ...so the whole thing looks like this: $pictureURL = explode("/",$display['praisePic']); str_replace('src="images','src="../images',$pictureURL); $picture = ''; for($i = 0; $i <= count($pictureURL) - 1; $i++) { $picture = $picture . $pictureURL[$i] . '/'; } $picture = $picture . $pictureURL[$i]; ...i know i'm doing something wrong, but i'm at a loss. anyone feeling helpful? thanks!love,jason
  13. as it would turn out, i was travelling in the absolute wrong direction when i was trying to create my article library......i also didn't make any sense in asking the question......so. what i ended up doing was using a $_GET variable (i figured out how they worked) to feed the article title to my database, which then pulls up the article on a separate page......if that didn't make any sense, you can look at it HERE. click on the "more" link for the article "Let Go Of The Rock" to see how i used the $_GET variable......thanks for trying. sorry i don't make more sense...love,jason
  14. i'm within inches of completing my first content management system. this is my last step before i just start adding bells and whistles to it......i'm trying to create a page where the user can upload an article or blog that will be saved in a database......i'm trying to then figure out how to create a page where the URL will have variables in it that the page will read to determine what to display. something like:http://www.mysite.com/articles?id=24where the "id=24" would be my article ID in the database. i know this is possible, and i found a tutorial on it, but i can't seem to get it to work. i've never dealt with .htaccess or even $_GET variables before, so i'm in totally foreign territory here......i'll try to explain where i'm at right now......my .htaccess file is in the site's root directory (which is a subdirectory on my host's server). i checked into it, and from what i can tell, the host DOES support .htaccess and mod_rewrite. the tutorial i found said i would need an .htaccess file, a file called croute.php (it implements the mod_rewrite. i think.), and my file that will use the $_GET variables (in this case, index.php; placed in mysite.com/articles)......my .htaccess file looks like this: RewriteEngine OnRewriteRule articles/(.*) index.php?parameters=$1 ...my croute.php looks like this: <?php$params = array();function Router(){ global $params; $explode = explode("/", $_GET["parameters"]); for($i=0; $i < count($explode); $i++){ $params[$explode[$i]] = $explode[$i+1]; $i++; }}Router();?> ...and my file to use all of this (just a test to see if it works for now) looks like this: <?php include("croute.php")?><html><head><title>Let's View An Article!</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><?phpforeach($params as $x1 => $x2){ echo $x1.": ".$x2."<br />";}?></body></html> ...now, i'll be the first to admit that i have no idea what's going on. i don't know if i'm even on the right track. any help at all is HUGELY appreciated...love,jason
  15. right......the question was, "is there a way to get my iframe to size itself vertically to the content it contains?"...i know how to size it manually. thanks for the help, though...love,jason
  16. hey, guys!...i'm using an iframe in a project i'm working on, and depending on the selection of a dropdown, the content of the iframe changes......the problem i'm running into is that one of my pages contained in the iframe has a LOT of content on it, requiring a scrollbar. now, i want to avoid scrolling my iframe as much as possible......i know i can just set the height on my iframe to some ridiculously high number to contain all of the page's content, but i don't want all that space there when the other pages are in the iframe......any suggestions on how to have the iframe set its height to fit the content? is that even possible?love,jason
  17. you could just addelse{ $word = ''; }...i'm not sure if you need it. i run several of these in my scripts without problems, and i don't have the else statement in there. i believe if the condition doesn't exist, it just passes over the code associated with the if......however, there is the possibility that an error is occurring that simply doesn't break the script. does anyone know for sure?love,jason
  18. the way i've been doing this is to use an if statement to put the HTML in the code AFTER it's out of the database. is that what you meant? if ( !empty($r)){ $word = '<h2>'.$r['word'].'</h2><br/>'; $class = '<span class='blue'>Class:</span>'.$r['class'].'<br />';//etc, etc...}echo $word.$class.$pronounce; you can put additional "if" statements in to allow for an item to be blank, like your "related terms" section. you can have that variable contain nothing so it won't output a blank span... $word = '';//query the databaseif( !empty($r['word'])){ $word = '<h2>'.$r['word'].'</h2><br/>';} i hope i'm on the same page as you are. i think this is what you were asking...love,jason
  19. i'm using a basic class "w360" that looks like this: .w360 {width:360px;}...i'm sizing all of my form entities with it, which hasn't caused me any problems yet, except with the <input type="file"> tag. in IE, it's working just fine, but with FF it's simply not recognizing that attribute......is there a way to give a file input a fixed width that works in all browsers?...thanks for your help!love,jason
  20. did you do the artwork at the top? if you did, try using illustrator or fireworks for the text; as it is, it's a little hard to read and definitely looks fuzzy......other than that, everything looks pretty good. someone mentioned earlier that the yellow bar should come out of the hover image, and i agree with that. it's a little distracting...love,jason
  21. can someone tell me why print_r() is returning this when i input my array from a mysql_query?...my table doesn't have any of the numbered columns, so i'm just trying to figure out if it's a quirk of the command or if i've got something really weird happening... Array ( [0] => 1 [praiseID] => 1 [1] => Jason Lengstorf [name] => Jason Lengstorf [2] => Web Designer [titleLine1] => Web Designer [3] => Ennui Design [titleLine2] => Ennui Design [4] => http://www.ennuidesign.com [webURL] => http://www.ennuidesign.com [5] => Test testimonial text. [praiseText] => Test testimonial text. ) ...thanks!love,jason
  22. i'm a rather rare breed of idiot......i was calling the wrong row names...love,jason
  23. awesome point. i'm learning how important it is to build in the proper order the hard way right now...love,jason
  24. i found a login script on Free2Code.net, and i'm attempting to integrate it into my site. however, i don't think my server supports PEAR DB scripting......so i've figured out how to successfully retrieve a username/password combination from the server and redirect to my update page (i'm attempting to create an admin login for site users)......my update page includes a file called 'check_login.php' which is almost directly off of Free2Code.net, and i think i'm either setting my session variables incorrectly or i've got a mistake in my verification code......here is my loginScript.php file: <?php session_start(); require 'nGe_db-connect.php'; $username = $_POST['username']; $password = $_POST['password']; $loggedIN = 0; $<?php session_start(); require 'nGe_db-connect.php'; $username = $_POST['username']; $password = $_POST['password']; $check = mysql_query("SELECT user, pass FROM nGe_login WHERE user = '".$_POST['username']."'"); $result = mysql_query($check); $info = mysql_fetch_array($check); if (mysql_num_rows($check) == 0) { $pageName = 'Site'; include('siteLook.php'); echo '<html><head>' .'<link rel="stylesheet" href="nGe.css" type="text/css" media="screen,projection" />' .'</head>' .'<body bgcolor="#FCFADB" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">' .$siteLook .'<div class="content"><p class="content">That username/password combination is incorrect!</p>' .'<form action="loginScript.php" method="post">' .'<input type="text" class="w125" name="username"><br/>' .'<input type="password" class="w125" name="password"><br/>' .'<input type="submit" class="updateBTN" name="page_mode" value="Log In"></form></div>' .'</body></html>'; exit; } $_POST['password'] = stripslashes($_POST['password']); $info['pass'] = md5(stripslashes($info['pass'])); $_POST['password'] = md5($_POST['password']); if ($_POST['password'] != $info['pass']) { $pageName = 'Site'; include('siteLook.php'); echo '<html><head>' .'<link rel="stylesheet" href="nGe.css" type="text/css" media="screen,projection" />' .'</head>' .'<body bgcolor="#FCFADB" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">' .$siteLook .'<div class="content"><p class="content">That username/password combination is incorrect!</p>' .'<form action="loginScript.php" method="post">' .'<input type="text" class="w125" name="username"><br/>' .'<input type="password" class="w125" name="password"><br/>' .'<input type="submit" class="updateBTN" name="page_mode" value="Log In"></form></div>' .'</body></html>'; exit; } // if we get here username and password are correct, //register session variables and set last login time. $_POST['uname'] = stripslashes($_POST['uname']); $_SESSION['username'] = $_POST['username']; $_SESSION['password'] = $_POST['password']; header("Location: phat2575.php"); exit; ?> ...and this is my check_login.php code. i include this file in 'nGe_db-connect.php', which is simply my MySQL login information with an include() for this file at the bottom... <?phpsession_start();if (!isset($_SESSION['username']) || !isset($_SESSION['password'])) { $logged_in = 0; return;} else { // remember, $_SESSION['password'] will be encrypted. if(!get_magic_quotes_gpc()) { $_SESSION['username'] = addslashes($_SESSION['username']); } // addslashes to session username before using in a query. $pass = mysql_query("SELECT pass FROM nGe_login WHERE user = '".$_SESSION['username']."'"); if(mysql_num_rows($pass) < 0) { $logged_in = 0; unset($_SESSION['username']); unset($_SESSION['password']); // kill incorrect session variables. } $db_pass = mysql_fetch_row($pass); // now we have encrypted pass from DB in //$db_pass['password'], stripslashes() just incase: $db_pass['password'] = md5(stripslashes($db_pass['password'])); $_SESSION['password'] = stripslashes($_SESSION['password']); //compare: if($_SESSION['password'] == $db_pass['password']) { // valid password for username $logged_in = 1; // they have correct info // in session variables. } else { $logged_in = 0; unset($_SESSION['username']); unset($_SESSION['password']); // kill incorrect session variables. }}// clean upunset($db_pass['password']);$_SESSION['username'] = stripslashes($_SESSION['username']);?> i've been troubleshooting this system with absolutely no luck, and i'm out of ideas. i'm hoping someone who hasn't been staring at this code for hours will be able to pick out the error without too much trouble......thanks so much for your help!love,jason
×
×
  • Create New...