-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
Add something to the myList table that indicates, for each row, who it belongs to. Then put all the users' selections in there.
-
It retrieves stuff from that server, after telling it which site it's running from and some information about the user, then will probably output whatever stuff it got back. It means they can put on your site anything from ads to malware to malicious Javascript to basically anything they want. Only thing it won't do is execute arbitrary PHP code.
-
"Query" you say? So this is coming from a database query already? That's actually the best place to do this: change the query so that it groups and totals for you. What's the rest of the code?
-
Did you copy that expression from some C# code? Tsk tsk. The preg_* functions need delimiters around the expression. Delimiters such as /s. if(!preg_match("/^\(?([0-9]{4})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/", $_POST["phone_number"]))
-
Ask the service hosting the form? Maybe they send in bulk, maybe there were problems between their mail servers and yours, maybe it took time for your mail system to vet the emails before relaying them to you... Look at the full headers for one of the messages - that should tell you some more detailed information about what happened during the life of the email.
-
What have you tried so far?
-
Probably, but your question doesn't make sense. Load into what? What is changing and how does that affect what you're doing with $html? It sounds like the problem you're trying to solve may be much simpler than you think it is.
-
Extract data between two points from a file
requinix replied to oracle765's topic in PHP Coding Help
Then you should have mentioned that. In the other thread. Instead of making another thread for it. -
Extract data between two points from a file
requinix replied to oracle765's topic in PHP Coding Help
http://forums.phpfreaks.com/topic/285731-split-file-into-seperate-files/ -
What you've described sounds like it would work (it's a little vague). What's your code?
-
Sure it can do that - as long as you tell it how. For each file, 1. Read a line. It'll look like ### LABEL ###. Create and open a handle for whatever file should hold the following contents. 2. Read a line. If the line isn't empty then write it out to whatever file you had opened. Repeat. 3. If the line is empty then close the file and, if you aren't at the end of the file yet, go to step 1. - You can read a line with fgets() but remember that it includes the trailing newline and so you should probably remove it with trim() before you look at it too closely. - fwrite() to write a line. - Check if you're at the end of the file with feof().
-
...unless you go for the full FOREIGN KEY (user_id_fk) REFERENCES table (user_id) (ie, actually tell MySQL of the foreign key relationship) in which case MySQL requires keys on both columns and will make them if you don't so yourself. Using FOREIGN KEY Constraints
-
That's two queries. Execute each one individually using your preferred database-handling code, such as PDO, mysqli, or whatever your framework provides (if you are using one).
-
htaccess - how could I remove a folder in the path?
requinix replied to milanello72's topic in Apache HTTP Server
Okay, well, if you want /index.php to actually go to /katarina/index.php then RewriteRule ^/?index.php$ katarina/index.php [L] -
htaccess - how could I remove a folder in the path?
requinix replied to milanello72's topic in Apache HTTP Server
What are you going to do about the file that's actually /index.php? What about all the other files in the katarina folder? -
You can't do it like that. You have to use a separate line of code to do an assignment. You need to use those options at some point, right? Use the $CURL_OPTIONS as a template and then provide the specific information (ie, the CURLOPT_PROXY value) at runtime. $options = self::$CURL_OPTIONS; $options[CURLOPT_PROXY] = $this->getProxy();
-
You're moving favicon.ico to images/favicon.ico. What changes do you think you need to make? Give it a shot: it's not like getting it wrong will destroy the world or anything. But what's the rest of your .htaccess that forced you to add a RewriteRule like that? Maybe this thing can be completely avoided.
-
Your latest code? Because you can't make a function "public" unless it's inside a class. Because you can't use strpos as just some name floating out in the middle of nowhere. Because you can't do multiple conditions in an if like that. Because strtolower() only has one parameter. Because strtolower() returns a string, not a boolean. Because if you lowercase the user agent string then you'll never find any bot names with capital letters. Because you can't use $bot outside of the function where it was defined. I have some bad news: you have no clue what you're doing. If you want the code to be changed then you should find someone to do it for you.
-
Array to json is giving me trouble, help please...
requinix replied to Rita_Ruah's topic in PHP Coding Help
Before anything else, how about you post all the code you have right now, including whatever PHP isn't working and/or whatever Javascript/AJAX isn't working. -
Array to json is giving me trouble, help please...
requinix replied to Rita_Ruah's topic in PHP Coding Help
json_encode() will not output that but instead [{"name":"MR A","location":"A LAND"},{"name":"MR B","location":"B LAND"}]Note the quotes around "name" and "location" and the lack of whitespace. -
That's not your actual code. I say this because what you've posted is not valid PHP code. Can you please copy and paste your exact code?
-
For the record, are you posting your exact code? Because if you are then it isn't executing in the first place because it's not valid syntax. Plus, is_bot() does not (as far as you've posted) exist so that won't work either. But to answer the question, you can make the function return not true if it finds the string, but the string it found. It can still return false if not. Then, when you call the function, you assign the return value to a variable and if it's not empty then it'll have the bot name. And one more thing: MSIE, "Microsoft Internet Explorer", and "Mozilla/4.0" are not bots.
-
The function, technically a class method, returns a boolean true or false depending whether it found one of those bot strings. Call the function and output whatever message is appropriate. Returning values from functions if/else if
-
is_numeric if one of the inputs isn't numeric then echo message!
requinix replied to oobradersoo's topic in PHP Coding Help
Where in there is the change that ginerjm told you to make?- 8 replies
-
- php
- is_numeric
-
(and 2 more)
Tagged with: