Jump to content

ober

Staff Alumni
  • Posts

    5,327
  • Joined

  • Last visited

Everything posted by ober

  1. You cannot move the file to an HTTP location. You have to use the local filesystem: move_uploaded_file($_SERVER['document_root'].'/picfolder/blah.jpg');
  2. Is there a reason you are using PDO versus the default mysql libraries? If you specify more than one column name (column1, column2 instead of *), does it work?
  3. PDO is meant to be abstract (able to talk to multiple DBMS systems within one protocol) and therefore you're going to lose some of the database specific functionality. In my opinion, if your application will only ever use MySQL, why would you ever go to an abstract method for communicating with that database? Performance aside, that should be enough to keep you away from PDO. PDO is also not as easy to use and any performance gain, if there is one, would be negligible if your application is written correctly and your database is normalized and indexed properly.
  4. Instead of: <div id="database"> <p class="titel"><?php echo $rij['titel']; ?></p> <p> U heeft geselecteerd id <?php echo $rij['id']; ?></p> <p> Dit is <?php echo $rij['titel']; ?></p> </div> You'll need to run a query before that that pulls the data out of the database again based on the ID: $id = mysql_real_escape_string($_GET['id]); $query = "SELECT * FROM allposts WHERE id = $id"; Does that help? So instead of $rij, your array would be the row you pull from the database based on the ID.
  5. Why not? I only use the net for porn and to annoy you poor chaps.
  6. Cron is server side. It cannot execute JS, which is client side. Without cron, you cannot schedule a page to be executed on a specific interval. The only way to do this is with a meta-refresh or a JS timeout, both of which require a browser to be open all the time.
  7. You have to look at whatever is being passed in the URL. So once you submit, you probably have something like: www.whatever.com/page.php?req=submit&field1=5&field2=blah So in your display of the answer options, you just say: // $current_option would be the value from the row you are entering into the answer options $selected = ""; if($_POST['field2'] == '".$current_option."') { $selected = " selected"; } echo '<option value="'.$row_getType_of_school['school_type_id'].'" '.$selected.'>'.$row_getType_of_school['school_description'].'</option>';
  8. You can certainly do that... but I'd recommend using a database instead of text files. Each thumbnail would then have a value in a record in the database that would contain the link to the full image/gallery or whatever and you build the links dynamically. Titles and comments and whatnot would just be additional fields or tables in the database. Now... asking us for a code example of all of that would be a bit much, but if you need something specific, ask away.
  9. The variable is always going to be set if it is created. You want to look at the count of the array items. if(count($IntName) > 0) { // blah } else { // blah }
  10. You shouldn't be dumping an entire page to one variable and then echoing that. Look into output buffering. That should solve all of your problems. ob_start() would be a good function that should lead you to the rest of them.
  11. I didn't notice any mention of testing on the magnetic fields to see what the effects on the human body might be. Transferring that much power across a room has to have some kind of negative effect, or so I would think.
  12. I believe he interchanged the word "password" for "captcha".
  13. Try reading it again. He's talking about the captcha phrase.
  14. He specifically said that it was during the registration process.
  15. Right... and reducing the complexity of the captcha will most likely make it so that upper and lower case won't be required.
  16. ... there are about a million reasons why this will never be installed. Isn't this why we did the bookmark mod??
  17. register_globals is most likely turned off. corbin is probably right and you need to do something like: $filename = $_GET['filename']; And don't forget to clean it. Only bad programmers accept URL input blindly.
  18. Hno, this is the manual: http://www.php.net/. Manual, this is hno. Go forth, and multiply.
  19. Uh.... since when? OK, so it's not an absolute requirement, but it is generally a good idea. Otherwise PHP has to do the path resolution itself and effectively search for the file in the file structure (read: extra processing time). The way this is being handled by this user is also somewhat insecure. I would never pass a path in my file system with a specific file name via URL. You're also creating a file based on user input. ALWAYS a bad idea. And I know you're just creating a blank file at this point, but I can only assume that there will be more to the script about the contents of the file.
  20. echo the path before checking to see if it exists to ensure that it is being passed the path you think it should be. I think you may need to add a / to the path before the filename, but it should throw an error, not tell you the file exists.
  21. file_put_contents would probably be your best bet then.
  22. Remove all white space. You probably have a tab character at least in there according to the spacing. Depending on your editor, that could be your problem. Also, one of the error messages points to your ability to save session data. Have sessions ever worked for you on that server?
  23. I would say it's going to fail about 50% of the time because people will block you via their servers. Otherwise, you can start reading here: http://br.php.net/manual/en/function.fread.php
  24. Please post the exact code and make sure you are not including this file inside another file that already sends information to the client.
×
×
  • 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.