ober
Staff Alumni-
Posts
5,327 -
Joined
-
Last visited
Everything posted by ober
-
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');
-
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?
-
[SOLVED] Anyone done some benchmarks or compared work before?
ober replied to bluejay002's topic in PHP Coding Help
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. -
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.
-
Why not? I only use the net for porn and to annoy you poor chaps.
-
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.
-
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>';
-
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.
-
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 }
-
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.
-
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.
-
I believe he interchanged the word "password" for "captcha".
-
Try reading it again. He's talking about the captcha phrase.
-
He specifically said that it was during the registration process.
-
Right... and reducing the complexity of the captcha will most likely make it so that upper and lower case won't be required.
-
... there are about a million reasons why this will never be installed. Isn't this why we did the bookmark mod??
-
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.
-
Hno, this is the manual: http://www.php.net/. Manual, this is hno. Go forth, and multiply.
-
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.
-
?? What?
-
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.
-
file_put_contents would probably be your best bet then.
-
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?
-
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
-
Please post the exact code and make sure you are not including this file inside another file that already sends information to the client.