-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
What do you think of the new look of these forums?
Adam replied to smerny's topic in PHPFreaks.com Website Feedback
I prefer them as they are, simpler. Hate going to new forums and just being confused by what the icons are supposed to mean. -
please give unbiased review about site design
Adam replied to keyur.delhi's topic in Website Critique
Supporting the bash against flash, this is all I see on my work computer: [attachment deleted by admin] -
Edit: beaten to it!
-
[RESOLVED] Fatal error: Call to a member function login() on a non-object
Adam replied to Jumpy09's topic in PHP Coding Help
It means $session isn't an object -- where is it declared? -
There's no use in "math tricks" (as you put it) like that. Adding the 1 at the start would void any MySQL calculations, which is generally the greatest benefit of using number types. Just store the number as a string.
-
What do you mean "not accepting"?
-
I'm personally not keen on video tutorials. I find it easier to digest something at my own speed and through reading it myself.
-
From the OP I got the impression he wanted to check if the function exists, you may be right.
-
window.pint() doesn't do anything other than trigger a print page. If you want something to display only as you print a page you should look at using the CSS print media type.
-
Use the 'typeof' operator to check it's defined as a function: if (typeof ChgTxt == 'function') {
-
This is now a HTML error, not PHP. The reason your image isn't showing is because you're applying it as a background image in a empty div - which because it's empty isn't showing. You can 'force' it to display by adding in whitespace with (remember normal whitespace is ignored by default in HTML). As I was saying however, a normal HTML image tag seems like it would be better suited here.
-
Unfortunately there's nothing like that in JS to my knowledge, though I imagine that wouldn't proove an effective solution anyway.
-
That's because you're div tags are empty. If you were to force white space with you should see it appear. Would an <img /> tag not be better suited here though?
-
That's because you're closing the string on the previous line. Move the single quote on the end of the previous line to after </div> followed by a semicolon.
-
.. Where are you wanting to go?
-
Not sure if you realised this but the default form action is "get" and you're using $_POST .. Edit: what was the problem?
-
Ah. Assuming the keys match up, you should be able to use: foreach($_POST['catID'] as $key => $catID){ if ($_POST['score'][$key] == "1"){ // represents a checkbox with a value of 1 $insert = mysql_unbuffered_query(" insert into test_results values('".$_POST['id']."', '$catID', '1') "); }else{ $insert = mysql_unbuffered_query(" insert into test_results values('".$_POST['id']."', '$catID', '0') "); } } You'll want to secure your inputs though!
-
So there's just 1 "score" checkbox? What's the current problem / errors you're receiving with that code?
-
What other actions? Inputs aren't really designed to work like that. What you would probably have to do is set the focus back every time they do these other 'actions'.
-
Not sure I follow you. You want to loop throug the catIDs array, and if it equals 5, and if the corresponding index in the score array is checked (1/true), you want to...?
-
A hell of a lot of people would say programming isn't "cool". You must be going to the wrong parties. Or maybe he is going to the right parties? I'd guess not if he'd rather spend his evening programming than go to one.
-
A better solution would be a switch, that way you can specify the "default" page (home.html): switch ($_GET['p']) { case 'page1': include 'page1.html'; break; case 'page2': include 'page2.html'; break; // add more pages here default: include 'home.html'; } In my opinion though an even better solution for this kind of setup would be to use an array. This would also allow you to add in a 404 style page when the user tries to access pages that don't exist: $valid_pages = array( 'home' => 'home.html', 'page1' => 'page1.html', 'page2' => 'page2.html' ); if (!isset($_GET['p'])) { $template = 'home.html'; } else { if (!array_key_exists($_GET['p'], $valid_pages)) { header("HTTP/1.0 404 Not Found"); $template = 'error.html'; } else { $template = $valid_pages[$_GET['p']]; } } include $template;
-
before i HTML it up, someone needs to tell me how dumb i am...
Adam replied to thewooleymammoth's topic in Website Critique
Well you didn't originally mention that this was part of the same "chain". However notice that yes, they have the same themes and wooden effects but notice the differences between the two sites. They are completely different yet follow the same style. That is more than likely what they're actually asking of you.. not a like for like copy. Not digging at you by the way, clients are infamously incapable of explaining what it is they really want. -
A hell of a lot of people would say programming isn't "cool". You must be going to the wrong parties.