-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
To be honest it would probably be better for SEO, since there's no design features clogging up the mark-up. However those are the pages the search engines will index, and of course, that's where the user will be taken; content only pages.
-
[SOLVED] Somone give me the Date code for this? r/fast
Adam replied to Gayner's topic in PHP Coding Help
It's not hard to work out if you just follow the manual... echo date('D, M j Y, h:ia'); http://uk2.php.net/manual/en/function.date.php -
Perhaps asking PHPIDS themselves, or on the PHPIDS forum would get better help? I'm sure if this is something they hand out someone else must use it.
-
Echoing mixture of variables and text from a text file ?
Adam replied to johnnycashpoint's topic in PHP Coding Help
Florida I think. Mid-day here in the UK though but I'm battling a hangover. -
Echoing mixture of variables and text from a text file ?
Adam replied to johnnycashpoint's topic in PHP Coding Help
Hah brain totally isn't in gear yet, read that completely wrong. -
Echoing mixture of variables and text from a text file ?
Adam replied to johnnycashpoint's topic in PHP Coding Help
Perhaps something like: $str = 'One day I went to the park with {name} One day {name} went to the park with me I saw {name} at the park one day {name} and I were at the park'; $str = str_replace('{name}', $name, $str); -
how to display a login error message on the same page
Adam replied to benjipie's topic in PHP Coding Help
You're basically testing for $_POST['submit'] which is never submitted with the form. You need to name the submit button like this: <input type="submit" name="submit" class="loginButton" value="" /> -
Clue's in the error.. "Class 'TPFolioHelper' not found". Basically means you haven't included the neccesary class files. Take a look at other parts of your code base and see if they "include" / "require" any files you don't (likely to be at the top of the file).
-
There are many ways you can join a string, probably the most simplest method being to concatenate several variables together, for example: $user_info = $fname . "\n" . $lname . "\n" . $email; //etc. It would depend how you want the information formatted in the text file though as to what you would join them together with. In the example I'm using "\n" which is a line break. So the data in the text file would end up being (with example data): John Smith jsmith@example.com You'd probably want either a double line break ("\n\n") or some form of delimiter to know 2 sets of data apart. The example I gave is, as I mentioned using line breaks, but you could also use other delimiters such as: $user_info = $fname . "||" . $lname . "||" . $email; //etc. Which would give you: John||Smith||jsmith@example.com You could then separate sets of data up with a line break or a different delimiter (e.g. "||||"). If you're feeling up to it though I'd suggest entering the user data into an array and using JSON or serialize, store the data in a more interchangeable format.
-
'join' / 'concatenate' the strings before using them with frwite...
-
Best bet in your case is to join the strings and enter as a single fwrite; which you could then test the success of quite easily.
-
Take a look at how it's used in the manual: http://uk.php.net/fwrite Basically concatenate the variables before writing to the file, or call fwrite multiple times.
-
Sorry? Unless you specify PHP to parse HTML pages it won't, however it's pretty easy to set it up that way. A quick search on Google will find you many, many tutorials I imagine on how to do it. You may need to re-work the code slightly.
-
I think the short_open_tag configuration may be disabled. You've got several blocks of shorthand tags around line 137, which if weren't parsed would cause the parse error.
-
validateEmail as I said before isn't actually a function, I literally just threw it in as an example (in an effort to try to reduce confusion lol). Loads of functions & regular expressions available on the net you can incorporate into the code.
-
Try this: $str = 'View John,Doe ;return'; if (preg_match('/View(.*?);return/i', $str, $matches)) { print_r($matches); } You'll need to trim each match to remove any white space issues, but if this is user entered data you'd probably be better off trimming the data anyway; in-case they entered multiple spaces by accident. If this isn't user entered data you may wish to add the spaces back in like on the other examples. I've also added the 'i' modifier to make the expression case-insensitive - again if it's user entered data it's probably a good idea.
-
There are no 'else' statements (that aren't commented out) in that code. Is that definitely as you have it on the version you're testing?
-
If I understand you right, you mean the content outside of the pop up to be completely invisible... what's currently darkened out? If so you can just edit the CSS of the "#blanket" DIV like so: #blanket { background-color:#FFF; /* or whatever color you want it to be */ position:absolute; z-index: 9001; /*ooveeerrrr nine thoussaaaannnd*/ top:0px; left:0px; width:100%; } Note I've removed the "opacity" property.
-
(.*+) should be: (.*?) or (.+?), depending on whether it must match '0 or more' characters or '1 or more', respectively. Edit: Also I can't see any real real point in using preg_match_all() with the start and end of string anchors.
-
how to display a login error message on the same page
Adam replied to benjipie's topic in PHP Coding Help
Edit: Oops. mis-read. Ignore this. 2 minutes... Edit 2: Show the HTML form... -
Ha no it's all good, led me on to learn the use of the \k character class.
-
I'd recommend reading this: http://www.regular-expressions.info/possessive.html
-
Seems a little trivial creating 3 variables out of an array in that sense, but I'm assuming there's a reason behind it. I don't believe you can concatenate two variables together in that way to form a variable variable, you need to create the variable name first and then use that to create the variable variable, like so: $var_name = $jobloc.($i + 1); $$var_name = $addjobloc[$i];