Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. That is the full code from index.php?
  7. 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.
  8. premiso

    utf-8?

    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.
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. 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
  15. 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);
  16. SELECT MAX(commentid) FROM comment LIMIT 1 If that is what you are asking for, that should get the highest commentid value.
  17. 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.
  18. 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.
  19. http://us2.php.net/manual/en/sockets.installation.php Check out the installation document. You need to also enable the extension in the php.ini file.
  20. 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.
  21. 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.
  22. How about you post the html form code for us, so we can better help you.
  23. Glad I could help you with my mind powers!
  24. Are you sure you are saving and running the right file?
  25. 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.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.