KevinM1
Moderators-
Posts
5,222 -
Joined
-
Last visited
-
Days Won
26
Everything posted by KevinM1
-
jQuery has a very nice toggle function that will do what you want: http://api.jquery.com/toggle/
-
$where_list[] = "description LIKE '%$word%'";
-
He has to use isset because the error variables won't exist if the form values validate. In other words: if (trim($_POST['nume']) == '') { $hasErrorNume = true; // $hasErrorNume exists (is set) and contains true } else { $nume = trim($_POST['nume']); // $hasErrorNume does NOT exist (is not set) } ---
-
Nothing jumps out at me as being wrong. That said, what I like to do in these cases is use one variable to represent both the error case and the filtered value if validation checks out. In other words, something like: if (!empty(trim($_POST['name']))) { $name = trim($_POST['name'])); } else { $name = false; } // ... if ($name) // $name is true AND contains a legit value { // email code } This saves one from checking to see if an error variable exists or not. You know you'll always have a value for that input. You only need to see if it's legit or false/error.
-
Such as...? Right now, at the very least, you need to change your ftp credentials. Be sure to pick a strong password (16 characters long, with at least one lower case letter, one upper case letter, one number, one non-alphanumeric character, arranged in such a way as to not create a word found in a dictionary (e.g., not P1zZ@)).
-
Mind showing your actual code?
-
Again, have you attempted to echo the non-'fixed' $img? Have you turned on error reporting? Your code still has an error in it. Getting expected, 'correct' results does not mean that your code is actually written correctly. As others have said, PHP ignores white space. There's a good chance that, despite expected output being seen, this error/bug will pop up again under a different set of circumstances. You're better off debugging it properly than merely believing your impossible and meaningless fix worked and moving on.
-
Again, have you attempted to echo the non-'fixed' $img? Have you turned on error reporting?
-
Have you tried echoing $img?
-
Just pull the content from the db? I mean, it looks like you're storing whole PHP files in the db, which I doubt is necessary. A 'story' implies text, which should be all you're storing. If you do need to dynamically access a PHP file, simply store its path in the db and use include to access it. Again, eval is hardly ever necessary.
-
That's still a horrible, horrible way of doing things. Potentially dangerous, too, if your db was ever compromised. Eval is hardly ever necessary. You should really look into changing your design.
-
Wow, you're going about this in a completely wrong way. Are you storing the times of the events within the DB? If so, simply use a SELECT query to obtain all events occurring from today till the end of the carnival.
-
Figured it out and simplified my image replacement code.
-
You do realize you responded to a six month old post, right?
-
For some reason, none of the images I've set as element backgrounds are displaying. It's not a permissions issue as images that I use with normal <img> tags are working fine. It has to be a CSS issue, but I'm not seeing it. HTML: <!doctype html> <html lang="en-us"> <head> <meta charset="UTF-8" /> <title>Major Productions</title> <link rel="stylesheet" type="text/css" href="css/reset.css" /> <link rel="stylesheet" type="text/css" href="css/mp.css" /> </head> <body> <div id="site"> <div id="header"> <div id="nav"> <ul> <li id="home"><a href="#" title="Home">Home</a></li> <li id="about"><a href="about.html" title="About">About</a></li> <li id="portfolio"><a href="portfolio.html" title="Portfolio">Portfolio</a></li> <li id="contact"><a href="contact.html" title="Contact">Contact</a></li> </ul> </div> </div> <div id="content"> Major Productions blah blah blah </div> <div id="footer"> © Major Productions LLC </div> </div> </body> </html> mp.css: #site { width: 960px; margin: 0 auto; } #header { position: relative; width: 960px; height: 105px; background: url(images/Header.jpg) no-repeat; } #nav ul { position: absolute; top: 0px; left: 250px; overflow: hidden;} #nav ul li { display: inline; float: left; } #nav ul li a { display: block; height: 100px; } #home a { padding: 100px 0 0 0; width: 81px; height: 0px !important; height /**/: 100px; background: url(images/Home.jpg); overflow: hidden; } #home a:hover { background: url(images/Home.jpg) 0 -100px; } #about a { padding: 100px 0 0 0; width: 81px; height: 0px !important; height /**/: 100px; background: url(images/About.jpg); overflow: hidden; } #about a:hover { background: url(images/About.jpg) 0 -100px; } #portfolio a { padding: 100px 0 0 0; width: 101px; height: 0px !important; height /**/: 100px; background: url(images/Portfolio.jpg); overflow: hidden; } #portfolio a:hover { background: url(images/Portfolio.jpg) 0 -100px; } #contact a { padding: 100px 0 0 0; width: 96px; height: 0px !important; height /**/: 100px; background: url(images/Contact.jpg); overflow: hidden; } #contact a:hover { background: url(images/Contact.jpg) 0 -100px; } Again, only the images that are set with the background CSS property are affected. Removing the CSS reset file I'm using doesn't fix the issue. Any ideas?
-
Turns out the solution was simpler than that. The line was always being pasted off the canvas. D'oh! This is why I code.
-
I've never been graphically inclined, but I can normally figure out how to do what I need to do in order to get some not-quite-horrible graphics work done in PhotoShop. Unfortunately, that's not the case today. I'm trying to create some sprites for a CSS rollover effect, and it's not quite going as planned. Here's what's happening: I successfully made a smaller graphic that has the button background tiled on top of itself, and I copied the text layer over. The problem is that at either side of the text there should be a vertical gray line, but for some reason the lines aren't copying over from the overall layout PSD to the button PSD. I'm guessing it's because I created them using the straight line tool and it created a shape with a mask. I've copied the entire layer - shape and mask - but for some reason the line won't display (yes, I double-checked that it was supposed to be visible). Rasterizing the layer doesn't help. Any ideas? I'd just use a text or-bar, but it would be a pain to get the spacing right.
-
How to recall same function within that function
KevinM1 replied to soma56's topic in PHP Coding Help
Recursion may be the answer, depending on how $do_something is supposed to be set. function beach() { echo $do_something; $do_something = $some_other_thing; // <-- this is the key part... $do_something needs to eventually become 'fun', else you'll have an infinite loop if ($do_something !== 'fun') { beach(); } else { exit; } } -
The lack of formatting (read: indentation) makes it hard to read, but it looks like you're overwriting $result in your inner loop. Give it a more meaningful name to make it a separate variable from the $result in your outer loop.
-
With chopsticks.
-
You assigned '' to $column, so when you use $row['$column'], you're actually attempting to access $row[''], which obviously doesn't exist. In order to access a table row column, you need to either know the column name, or use a foreach to cycle through them all. foreach ($row as $key => $value) { echo "Column name: $key -- Value: $value"; }
-
Such as? Also, ActionScript and JavaScript share a lot of similarities due to their shared lineage.
-
Try: $sql = "UPDATE blog_dl SET title = '$title', body = '$post', poster = '$by' WHERE id = $id LIMIT 1;"
-
I'm not sure how many times I need to say it, you need to SELECT a field. I'm not selecting a field, I'm just seeing if it exists. In order to see if a field exists, you need to select it. This is SQL 101.