premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
This is most commonly done with preg_match. If you provide examples of the data in their raw format, I am sure someone can help you with a regular expression to extract the data. Alternatively, it is rss / xml you can try using simplexml.
-
Why are you trying to create a table just for the user? If I were you, I would read up on proper database design and the 3rd Normal Form.
-
The main reason is, the user ID can remain the same, but some users like the option to change their user name. If you do not reference it by ID, then you have to change the username in multiple tables rather then just 1 table.
-
Umm, mattal999, he is talking about the CLI (Command Line Interface) this is seperate from the PHP / Webserver. To answer your question zethrax, no you cannot. As those programs are coded into the kernel and programmed to be triggered with the tab. If, however, you really want this feature, you can compile the kernel with your program and auto-completeion items for the tab when that command is in the shell. But other then that I know of no means to do what you are wanting.
-
The data that cURL pulls back needs to be written to a file and given a .pdf extension and it will pull up properly when you view it, or at least should. Look into the fopen, fwrite and fclose operations for how to write to a file.
-
That is the full code from index.php?
-
HELP Create a dynamic variable by joining two together PHP 5
premiso replied to Alex C's topic in PHP Coding Help
I would suggest using an associative indexed array instead, but here is how you would achieve that: $item_number1 = "foo"; $item_number2 = "bar"; $i = 1; while($i <= 2) { echo ${$item_number . $i} . "<br />"; $i++; } Should do what you want. An array would be better a quicker, however. As an FYI. -
If you are using utf-8 charset you should change your DB to also use utf-8. The charset you want for the DB should be utf8_general_ci.
-
Are you running this via the CLI or browser? If a browser, some browsers have their own timeouts built in, IE: if no data is displayed on the page or sent to the browser in x amount of time they time out. So you may try running it as a CLI interface if you are not currently. If you insist on using a browser, you will need to try and flush some data to the browser in an attempt to keep it alive, however that only works on some browsers.
-
You have to use $vars to access the data you want. Ken did a print_r on the $vars to show a mock up of the possible variable you will get. If, you do not know how to use arrays or know what they are. I would highly suggest you get reading about arrays and their uses. They are essential, imo, to programming in PHP.
-
A simple cURL script can post data to forms. It is actually absurdly easy. The reCaptcha solution is what you want to look into. This should stop most bots from spamming, but humans will still be able to spam at will. As cyberRobot said, this is just spam, not injection.
-
Well, I never used the SERVER_PORT command before, so I cannot vouch for that at all. But reading some other forums, you may take a look at the ending parts of this forum: http://www.webmasterworld.com/apache/3970987.htm It talks about your vhosts file and how it needs to be setup properly for this to work right. Let us know if that worked and possibly the right steps you had to take.
-
Very possible. You can acheive this by setting a server on your local box and making it accessible to the world (note that this opens up security risks) and using a domain service like no-ip.com to have a "name" to send your phone to. To setup Apache on Windows see WAMP on Linux LAMP on Max MAMP ( I believe). Then you just have to setup the code you need.
-
Try this for the rule / cond's: RewriteCond %{SERVER_PORT} ^443$ RewriteCond %{HTTP_HOST} ^mysite.com RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,NC,L] If that does not work try this for the rule (keep the same conditions as above): RewriteRule ^(.*)$ https://www.mysite.com/$1 [R=301,NC,L] Since you are doing the port checking for 443, you should probably make the http be https
-
You can use the timezone function date_ timezone_ set to set the correct timezone you want to use. Or just add 3600 seconds to the date: $today = date('m-d-u H:i', time()+3600);
-
SELECT MAX(commentid) FROM comment LIMIT 1 If that is what you are asking for, that should get the highest commentid value.
-
Question Marks in Black Diamonds instead of apostrophes?
premiso replied to morocco-iceberg's topic in PHP Coding Help
Well if the data was entered in the latin mode from a page that was non-UTF8 charset encoded, yea. Try making a new post with the same characters and make sure the charset of the page that submits the data is UTF-8 and see if it works or not. -
You can do it by IP address. There should be a list of IP's that are used by Ontario somewhere and just check if they are from that IP.
-
PLEASE HELP! Sending email from php form checkbox area as "array"
premiso replied to oceanreaction's topic in PHP Coding Help
It "should" work. Do a print_r on $_POST['interest'] and see what format it is coming out as, post that information here as well. -
php actively closes the connection on script ending. It does not timeout unless the script timelimit is set to 0 (infinite) and then it may timeout. But yea, php is smart enough to close the connection for you.
-
PLEASE HELP! Sending email from php form checkbox area as "array"
premiso replied to oceanreaction's topic in PHP Coding Help
How about you post the html form code for us, so we can better help you. -
Glad I could help you with my mind powers!
-
PLEASE HELP! Sending email from php form checkbox area as "array"
premiso replied to oceanreaction's topic in PHP Coding Help
Are you sure you are saving and running the right file? -
Put it inside the class constructor, not the query statement. Opening and closing mysql connections every time a query is ran will cause an unneeded burden on your server. Infact you do not need to call mysql_close at all. As the connection is automatically closed by php after processing. But I would highly suggest against putting the connection string and opening / closing connections for each query. It is unnecessary and will cause more trouble then it is worth.