Jump to content

mme

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

Everything posted by mme

  1. Thanks its all working! I tried $row['date'] before but I did not know it was possible to do it like you said ($row->date). It formats the date as well as checks it against a generated hash. But thank you for your suggestion.
  2. Hi, I have the following code $rs = mysql_query('SELECT * FROM transactions WHERE acid='.$acc); $result = array(); while($row = mysql_fetch_object($rs)) { array_push($result, $row); } echo json_encode($result); Now I wish to change the value of a certain column in each row that is returned from the database. The column is called 'date' and contains a unix timestamo that I wish to format using my function stime($var,1). How would I do this? Kind Regards, mme
  3. Hi, I have this issue with wp-e-commerce (http://wordpress.org/extend/plugins/wp-e-commerce/) 3.8.8.3 that the pagination is broken. The url generated is as follows http://MYWEBSITE.com/products-page/page/2 it should be http://MYWEBSITE.com/products-page/2 Is there a way that I can use .htaccess to remove this from the url? Using Wordpress 3.4.1 Thanks, mme
  4. mme

    Comparing Dates

    Hi, I am trying to make a simple reservation program with PHP and MySQL. How do I check if that Room is available between certain dates. My Table looks like this: Thanks, mme
  5. Thanks I did not know such a simple function existed. This was exactly what I was looking for. -mme
  6. Hi, I am trying to split a string into an array and then seeing what sort of data it is. eg; I get the following string I need to be able to put this into an array so in this case myarray[type]=somethingelse myarray[api]=somerandomkeyhere myarray[user]=someuser myarray[password]=somehashvaluehere but it could include many more/less different value's separated by the & symbol. Thanks, -mme
  7. Hi, I am trying to make it so I can pass a new line of text from php to the ajax script while it is being executed. Then displaying this text on a new line each time (kind of a scroll log in Wordpress when it is updating plugins) example: <div id='mydiv'>text already here<p /> addtext('some text'); would add 'some text' to the existing text in a div <div id='mydiv'>text already here<p />some text Can anybody give me a simple tutorial or an explanation. Thanks, -mme
  8. Hi, I am trying to see if the domain name in the string is in an array. eg; mystring='http://google.com/somethingelse'; myarray[]='google.com'; myarray[]='anotherdomain.com'; in this case return TRUE mystring='http://phpfreaks.com/adir'; myarray[]='google.com'; myarray[]='anotherdomain.com'; in this case return FALSE How would I do this? Thanks, -mme
  9. Hi, I want the user only to be able to download the files directly if they are using a certain user-agent, I know it can be spoofed but it will stop some of them. is there a way to do this using .htaccess? Thanks, -mme
  10. No, I tried with both however no changes are showing so it looks like I am going to look for a different host. Thanks for all your replies and help.
  11. Thanks, I have figured out what the problem is. Is there any way to increase this? EDIT: already tried this but it does not seem to have any effect: Top of the page. ini_set('post_max_size','10M'); And also in my .htaccess php_value post_max_size 20M Thanks, -mme
  12. Thanks for your quick reply's, Hmm I just tried it with a smaller file which seemed to work without any problems. However It seems to get errors with larger files (2MB). Is there a limit as to how big an array value can be to post? 1. It seems to work with smaller files 2. According to my host it has a max filesize of 10MB
  13. $myfile=$_FILES['uploaded_file']['tmp_name']; What is the remote server going to do with that? Just trying to figure out why that's a parameter, since it's a local file that the remote server can't do anything with. My guess is that there's something that's messing up the post data between the '@' symbol an the file name, like an invalid character; unfortunately I'm really not too familiar with CURL. Thanks for your quick reply, Basically what it is doing is sending the uploaded file to another server which processes the $_POST['my_file'] variable as a file upload and stores the file on the server. if (!empty($_FILES['my_file'])) { move_uploaded_file($_FILES['my_file']['tmp_name'],$filename); } Hope that helps, Thanks, -mme
  14. $myfile=$_FILES['uploaded_file']['tmp_name'];
  15. Hi, I am trying upload files to a remote server using CURL however It is not sending all the values in the array. $auth_local='testing123'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $auth_remote_url[$auth_no] ); curl_setopt($ch, CURLOPT_POST, TRUE); $post_array = array( "auth"=>$auth_local, "auth_e"=>$auth_e, "my_file"=>"@".$myfile, "md5"=>$md5, "check"=>"0", "upload"=>"Upload"); curl_setopt($ch, CURLOPT_USERAGENT, "Test Upload"); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_array); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $response = curl_exec($ch ); curl_close($ch ); When I check the value of $_POST['auth'] it is blank. When I remove "my_file"=>"@".$myfile, It does read the correct value Why is this not returning a value? Thanks, mme
  16. This might help https://mail.google.com/support/bin/answer.py?answer=78799
  17. Thanks for your feedback, I was only using $_REQUEST for that one line of code the rest of the code was like you suggested. Now I have also added a session timeout using the DB so when no activity is made for x amount of minutes the session is 'deactivcated' and the user is redirected back to the login page. Any other suggestions?
  18. Hi, I have just started learning about sessions to use with a login system with SQL Now I was wondering if my method is secure? When login in before setting the $_SESSION variables I use the session_regenerate_id() function. All passwords and ids are stored as SHA-256 hashes in the MySql DB. I use the mysql_escape_string() and htmlspecialchars() functions to sanitize the input values of all DB query's and SESSION variables. Also the login page can only have 3 wrong attempts before the user is locked out. with a captcha after the first attempt. Once the user logs in on each 'protected' page it checks the variables in the $_SESSION variable against the DB value on each page if they do not match then it brings the user to login page. Also on start of each page: if (isset($_REQUEST['_SESSION'])) {die('No Hacking');} Just wondering am I missing something? Thanks, mme
  19. Hi I am trying to update some values in the database however I keep getting syntax errors: mysql_query("UPDATE updates SET ('file' = 'new.exe2', 'filename' = 'new.exe2', 'serverfile' = 'http://static.php.net/www.php.net/images/php.gif', 'md5' = '97f3c717da19b4697ae9884e67aab123') WHERE 'updateid' = 10;") or die(mysql_error()); However I keep getting this error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('file' = 'new.exe2', 'filename' = 'new.exe2', 'serverfile' = 'http://static.php' at line 1 What is wrong with the code? Thanks, mme
  20. Thank you so much. I have also changed it a little to include decimals. But everything is working now Thanks so Much -mme
  21. Thanks for the reply, What function could I use to get the 'word' out of the string? Thanks, mme
  22. Thank you for your reply, Basically I have a string of variable data in it and I want to add up all the numeric values in the string that have the $ character in front of the number. However I do not want the numbers with the $ character before the number to be added. eg; blabla 621. - Dont include this more text $63. with some more text 12. - Include the number 63 but not the number 12 Hope that helps. Thanks, mme
  23. mme

    Security

    Thanks for all your help, I have now done both, email and a password. Thanks, mme
  24. Hi, I currently have a string with some values in it: $a_random_string="some random text, goes here - $123<br>some more random text goes here - $53 (text 123 )<br>ANother line of text - $126"; Now I want to add all the values that have a '$' before the value eg; $123. So in this case I would end up with: 302 How would I do this? Thanks, mme
  25. mme

    Security

    Thanks for your quick reply, I have implanted the new changes so now the customer ID is encrypted and their email address is required. Thanks, mme
×
×
  • 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.