Jump to content

PaulRyan

Members
  • Posts

    876
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by PaulRyan

  1. <?php $c = curl_init(); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json')); curl_setopt($c, CURLOPT_URL, 'http://data.mtgox.com/api/2/BTCUSD/money/ticker'); $content = curl_exec($c); curl_close($c); $api = json_decode($content, TRUE); return print_r($api['data']['avg'], TRUE); ?>
  2. <?PHP $x = isset($_POST['x']) ? trim($_POST['x']) : FALSE; ?>
  3. You don't need the end tags, in fact it is considered bad practice to have them when including files. It prevents the dread header already sent error that happens when you leave space after the closing tag. It is best to emit them.
  4. In the "usersmysql.php" do you have the opening PHP tags? Like so: <?PHP $host="127.0.0.1"; $username="globaluser"; $password="d4TXz4ATHgcvqJx"; $db_name="project1"; $tbl_name="useraccounts";
  5. You missed the closing quote on this line. $username="globaluser;
  6. That error doesn't reference those lines, it's most likely somewhere else in the function. Post all of the code.
  7. You should have explained your question a bit better, but we got their in the end. You need to create a log in form, then check their log in details against the database. I assumed you had them logged in, but couldn't get the data you wanted back.
  8. The code you want to have on your page should definitely go above the header.php include part. This is to keep all processing above any output to the browser. Place this code above the header include, but below init.php include. echo '<pre>'; print_r($_POST); echo '</pre>'; Then check the output of that before and after form submission.
  9. Nope, that should do. Am I right in saying your problem is that when you submit the form, nothing is showing up? I.E. the text in the conditional statement? P.S. Could you post the content on init.php and header.php?
  10. I didn't quite understand this "i have my errors showing all right now" Do you have error reporting turned on? This may uncover an error from one of the included files.
  11. Are you sure? I can spot quite a few things that will output some errors for you to see. If the error reporting really did nothing, then you need to next debug your code, to see what is going wrong and where. I would display all the $_POST data on form submission, to make sure it is what you expect. Then I would debug your query, to make sure it is what you expect and also check for query errors too.
  12. I do apologize, I misinterpreted the error. Try placing the block you had, above the included files, probably want to put it below "init.php" and above "header.php", also, turn on error reporting too. Error Reporting
  13. When using "WHERE id = ?" you need to bind the id to ?. Where is the user's id coming from? A session variable?
  14. Firstly, you should turn on error reporting, you might be surprised what you find. Error Reporting
  15. <?PHP if($_SERVER['REQUEST_METHOD'] == 'POST') { // Do stuff } ?>
  16. The WHERE in your query should be searching against id and not firstname and lastname, you need to change it.
  17. Bitching? Where? Just a friendly debate. I gave the OP some advice on an earlier post I believe.
  18. I think you'll find I do understand PHP, you just don't understand English fully. He first has to upload the image, via a form (He doesn't have a problem with this, otherwise he'd have said so) Secondly, he wants to re-size any image that is above 1,500px, so it will work with his image slideshow (This is where he is stuck) You also don't understand JavaScript, you can't re-size an image using JavaScript. You can make it look smaller, but you can't physically change it's dimensions. You need to use PHP to find the ratio of how to scale the image, then save the image in the correct dimensions (All done by PHP)
  19. You are trying to return the users "firstname" and "lastname", by querying their "firstname" and "lastname". Should you be using the "id" to return the data you want. Use the $user_id variable to search the database and return the data.
  20. "How can I upload a bigger image and resize it" - Take note of the red text.
  21. That is correct, but the OP didn't state an issue with the actual upload. He/she stated an issue with the image dimensions.
  22. Yes really, you obviously didn't read the question properly. He wants larger images to be re-sized to 1,500px or less to work in the image slideshow.
  23. He probably has a dynamic I.P. address, which is very common in this day and age. There isn't much you can really do about it, you need to tighten up registration form, look at form tokens, re-captcha, also Google some tips to make forms less likely to be automated by a bot/script.
×
×
  • 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.