-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by salathe
-
It sounds more like some Flash-related problem than anything requiring writing (and managing) multiple files.
-
Why not try a whole bunch of different systems and see which works best for you? Personally, the main reason why I don't like (bad choice of words, subversion works and I do like it) subversion is because if I am "offline" (out and about, the server loses connectivity, wifi is off to save battery, whatever) then it makes life difficult because I can't commit changes. In those situation, with Git, my work flow isn't altered because I can commit changes locally without being online then let the remote server "catch up" (by pushing to it) when I do get online.
-
I think the OP means why not how. First, it is important to note that print is not a function so may cause confusion when called like one! The parentheses in the example code above are meaningless and only serve to give the false impression that the line of code will behave like normal function calls. When PHP evaluates the following line: echo print('3').'2'.print('4'); It might as well be: echo print '3' . '2' . print '4'; Both are identical. If we were to use parentheses to represent what is evaluated together it would look like: echo (print '3' . '2' . (print '4')); Working through this as PHP does: 1. Concatenate "3" with "2" to get "32" 2. Print "4" 3. Concatenate "32" with the return value from the second print (integer 1) to get "321" 4. Print "321" 5. Echo the return value from the first print (integer 1) so echo "1"
-
I'm on Sitepoint, but not TheRoot42. cags yes I had an interview and it went very well so we will see what happens from here.
-
Do you want to count overlapping character-combinations? For example, given "eeee" does "ee" occur only twice or three times?
-
First, worry about any and all user-submitted data. Second, there is nothing stopping an attacker from creating a page which forwards a post request from a page on their site (or a site they control!) to your page. All an unsuspecting visitor needs to do is hit their page, get automatically forwarded to your site (with a nasty payload in the POST) and the attacker can do whatever they like (send the visitor's cookie data, log keystrokes, etc.). All of this can happen, for example, in an invisible iframe and the visitor would not know a thing.
-
The file function will read a file into an array of the lines. Is that what you want?
-
Give us an explicit example of what you want. Will the two alphanumeric strings (e.g. namename) always be the same? Always surrounded with ".." and " ~"? Always have a single space between them? You say you want to match that entire string, but later say the ".." doesn't need to be matched, which is true? Please fill in the following (change the two "changeme" parts to what you want). $subject = 'changeme'; $pattern = 'we will figure this out'; preg_match($pattern, $subject, $match); var_dump($match); /* I want the output to be: changeme */
-
Please don't change the requirements, it is a common problem here. Please, in detail, describe what you want to achieve. It sounds like you want to match words enclosed in quotes (single, double or both?) and add some text after them. E.g. given "blah 'hello' blah" you want some output like "blah 'hello' text blah"? @Daniel0, lets get the question straight with the OP before looking at things like that, don't want to confuse them (or us, more).
-
You could buy them from nexen.net at one time, not sure if they're still available. Your local PHP User Group (if you have one) might also have some going spare.
-
[SOLVED] replace a <br /> with an empty space
salathe replied to tecmeister's topic in PHP Coding Help
I am intrigued to know why you want to undo what nl2br does, and replace it with something else. Why go through the process of adding BR tags only to substitute them with something else? -
Lets run through your code with the email set to "test". if(preg_match("~[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}~i", $email)) { return TRUE; } else { echo FALSE; } If the email "test" matches that pattern, the page execution is stopped (due to return) with a value of TRUE. In all likelihood, that is not what you want to be happening. If the email address matches the pattern (ie, is what you want to be considered a valid email address) then we want to allow execution to continue processing! Since our email "test" does not match the pattern, we are moved to the else block which echoes FALSE (an empty string, nothing). There is nothing here stopping the execution of the page so we go down to the next if block. if (empty($name) || empty($email) || empty($phone) || empty($dobday) || empty($dobmonth) || empty($dobyear) || empty($town)){ header("Location: error.php"); } else { $message = "Someone has filled out The Honey Club Mailing List Form:\n \n Name: $name\n Email: $email\n Phone: $phone\n D.O.B: $dob\n Town: $town\n"; mail ($myemail, "Mailing List Form", $message, "From: $email"); header("Location: formsubmitted.php"); } Lets assume all of the other values have been provided and don't constitute being "empty", we know that email isn't empty (remember, it is "test"). Because none of them are "empty" again we are moved to the else block. This one sends the email. In conclusion, if a valid email is provided (according to your regular expression) then execution of the page is stopped. If an invalid email is provided and one or more of the other values is "empty" then the page is redirected to error.php. If an invalid email is provided and all of the other values are not "empty" then, and only then, the email is sent. Can you see the problem?
-
I answer (or perhaps more correctly, give some insight to) questions.
-
Look into the "content negotiation" features in Apache.
-
Can somone donate me a few bucks? only need like 2-3$..
salathe replied to Gayner's topic in Miscellaneous
Do you have to use your PayPal balance; why not just pay with a credit/debit card via PP? -
Not any more. I have a job interview lined up and was given the choice between today or next Tuesday, I'm generally not very superstitious but I chose Tuesday.
-
Please be more descriptive, "it doesnt seem to [work]" is of no use to anyone. What is the incorrect output/value that you are getting and how does it differ from what you are supposed to get?
-
You could always force it to be an array: $keys = (array) array_rand($rand, 1);
-
What did you change and how does it not work?
-
Make sure the POST data is urlencoded.
-
I was going to offer suggestions but the mention of inventing wheels took me along a rickety path to spending a good half-hour reading a chunk of English Pleasure Carriages: Their Origin, History, Varieties, Materials, Construction, Defects, Improvements, And Capabilities (W. Bridges Adams, 1837). I know know the best way to construct a carriage wheel from wood (and iron hoop) but have completely forgot what I was originally going to post on the subject of your creating a forum from scratch.
-
Ask curl very nicely? Without knowing what you're doing (perhaps, doing wrong) we can't help you.
-
Please see PHP Operators, in particular the Arithmetic and Assignment operators for things like += and *=. For ++, see incrementing/decrementing. For for see the for control structure.
-
The stylesheet there is just for the site's default styling: everything else except for the example being shown.