ober
-
Posts
5,327 -
Joined
-
Last visited
Posts posted by ober
-
-
I can only imagine why you would want to do that. How about you tell us what you're trying to do and we can give you a better suggestion?
Grabbing the IDs isn't hard, but I'd like to know why you want to do it.
-
No one is going to write it for you... you need to take the first steps:
1) Learn how to connect to a database
2) Learn how to query the database
3) Learn basically display and navigation
None of these are simple enough for someone to just throw some code at you (and that wouldn't help you anyways). You haven't told us anything about the database structure or the data in it.
You've basically just asked a VERY open-ended question.
-
I would guess that you have a problem in your CSV file at line 134.
-
I don't see anything that says:
$_SESSION['blah'] = 'blah';
You're never setting anything to the session.
You might want to read through this: http://www.phpfreaks.com/tutorial/sessions-and-cookies-adding-state-to-a-stateless-protocol
-
I'm not sure where you read that, but I think the PDO methods are overly complicated compared to the native PHP MySQL functions. I would concentrate on those.
I cannot be sure why you're getting a timeout. Try using the MySQL extension functions and see if you get the same problem.
-
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?
-
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".
-
yeah, and he is getting the capture error for his password being invalid.
Try reading it again. He's talking about the captcha phrase.
-
I think what he is trying to say is that his password was invalid, and it was giving him the capture error instead of the password error. That is an SMF forum problem I would say.
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.
-
You are passing it a relative path. You need to provide an absolute path to the fopen command.
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.
Global variables are bad...
in PHP Coding Help
Posted
Requery the database or pass it via $_SESSION or some other super global array ($_GET, $_POST, etc).
As an example, I have a configuration table in my database where I store all my global settings. With each load of the page, it queries the database and loads that information to an array so I have it available to me anywhere I go.