-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
I don't really agree with the idea of a public tutorial submission system. Allowing the public to submit tutorials? Yes. But having them post it publicly, and having us tell them yes or no? No. I see a whole lot of drama happening from that. I mean, let's say JoeUser isn't really very good at PHP. He's not even good at writing (grammar, spelling, etc..) but his heart is in the right place and he wants to help. Now, I don't mind telling this person his submission is not good enough in an email or PM, but publicly? He's gonna have a hard enough as it is being rejected in the first place, but if we did it publicly, he'd have that humiliation on top of everything else. People PM us asking all the time to delete posts and threads of theirs because it was a "stupid" question and they are embarrassed about it. I can only imagine the level of requests received from something like that, and how much more intense they would be. And that's just the criers. Let's not even get into the people who would get really pissed about being told no. Again, I support the notion of anybody being able to submit tutorials, but I do not support it being done publicly, for our sake, yes, but mostly for theirs. My 2 cents.
-
sorry I read the join wrong idk why but I thought I saw it as "','"
-
$sql = "DELETE FROM docs WHERE docID IN ('$ids')"; Other than that...what are you trying to figure out?
-
echo "<tr><td id='title'>".substr($row['Block'], 1)."</td>";
-
I think I'd rather make an extra column with those numbers in it and sort by that column.
-
There's a million ways to write it because there's a million ways to code not just 1 site, but 2. There's really nothing we can specifically suggest to you without code. Also, Your original post suggests you just wanted to take a feature that's on one site and put it on another. Now you're saying you want to somehow link the two sites? Do you even control "site 2?" Because if you control both sites, I don't really see the efficiency in having site 2 do a search query and then turning around and grabbing that info and putting it on site 1. Why not just have site 1 query site 2's database directly? Or do you not have control over site 2... It sounds to me like you want to look into curl
-
True, but the principle is still the same. just change it from $_GET to $_POST
-
My crystal ball is in the shop. You're going to have to give more info than that.
-
I don't think you're understanding the point. The point is, you cannot use session variables unless php knows there are session variables. your condition works perfectly fine from PHP's point of view; you won't be getting any errors thrown at you. The problem is that it's not working as you expect, because unless you tell PHP that there are session variables in play (by putting session_start() BEFORE using them), it's going to always evaluate that condition as FALSE, because as far as PHP is concerned, it doesn't exist, because you didn't tell PHP that there are session variables. You did indeed use session_start() later on in your script for your other variables, but that doesn't do squat for you trying to use them BEFORE you used it. I don't really understand what you don't get about that...PHP cannot access session variables unless it knows there's a session. It knows there's a session because you put session_start() before trying to use session variables. I really don't know how else to put that.
-
hmm...okay I'm still not really understanding what exactly your problem is...if you know ahead of time what your $_GET variables are, simply assign them to normal variables: $snum = $_GET['snum']; $stone1 = $_GET['stone1']; $stone2 = $_GET['stone2']; $stone3 = $_GET['stone3']; or you could do a loop like this: <?php foreach($_GET as $key => $var) { $$key = $var; } echo $stone1; ?>
-
He said he doesn't want to truncate he wants to line break.
-
I can't understand what you're trying to do in your loop, nor exactly what you're trying to do from your explanation...You're going to have to at least be a bit more clear in what you're trying to do... if you have a url like say http://www.blah.com/index.php?stone=4 you can access that stone variable like so: // this will print 4 on the screen echo $_GET['stone'];
-
I was under the impression that it only has to be before headers are sent You are right. But, you need to put it before you make calls to session variables, which you don't seem to be doing, hence the previous posts.
-
The command needs to look something like this: GET http://yourdomain.com/path_to_file/file.php > /dev/null
-
how are you doing this cron job? on the command line? through cpanel?
-
How to assign checked checkboxes to an array upon submission?
.josh replied to blurredvision's topic in PHP Coding Help
I think I personally would suggest sticking to the original principle for the first 3, and for the last 2, since it's really only a matter of convenience for the user, use some javascript to automatically check/uncheck all of them on the form level, before the user submits. That way, you don't have to mess with all that. Because the way you are trying to do it now, you're going to end up having to submit all options regardless, like with a hidden field or something. -
With a for loop, you are executing a specific amount of iterations. With a while loop, you are executing it indefinitely until the condition is false. The usefulness of a while loop is for instance when you are retrieving info from a database and you don't necessarily know how many results are going to be returned, so you don't really know how many iterations to make the loop.
-
Are you wanting to do a for loop instead of a while loop? for($x = 0; $x < 10; $x++) { // do something here }
-
did you echo out $lastactive and $nowtime to see if they are holding what you expect?
-
Yeah that's an alternative but thing is, that creates a lot more unnecessary load for your server, and is also dependent on users clicking it. What happens when you have a dry spell and nobody's there clicking? I guess that kind of falls under the "If a tree falls in the forest and noone is there, does it make a sound?" category: that is, it doesn't matter if it's showing people as "online" if nobody is there to see it...but still. But hey, if you're happy with that, then go for it.
-
The problem is that your query failed, so it returned FALSE (a boolean). Where is your script that connects to your database? The second error is a result of the first error, in that since $row failed to be assigned, it's not an array and therefore has no indexes.
-
well the time() function returns the current unix timestamp in seconds so if you take the current timestamp in your db and format it to that, you can do a simple if (($nowtime - $dbtime) > 300) { // 300 is in seconds so that's 5 mins // change user status }
-
Make a script that connects to your database, queries for email addresses, and sends an email to them. Assuming that you have a mysql database, lookup php mysql functions for how to connect and query, and look into php's mail function. As far as sending it out daily, You will want to setup a cron job to run that script every day.
-
Ah damn, I don't know how I missed that. I fail.
-
...or login.php. At the very beginning you are checking for the session array but there's no session_start() before that to let your script know there could be.