-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
well..I suppose you could like, query your db, get the text, split it up and all that...but yeah, that's not really the point of php....
-
assuming you have a database and have info in a table: (untested, not on my computer) // select all players, ordering list randomly $sql = "select players from table order by rand()"; $result = mysql_query($sql); // loop to get data from result source while ($r = mysql_fetch_assoc($result)) { $list[] = $r['players']; } // make a 2d array each pos has 2 players in it (last pos will have 1 player if there's // odd number of players $pairs = array_chunk($list, 2); // formatting the results is really up to you...
-
well if you want to nickel and dime here you should use a db because that's like, what they are good for.
-
banning users on the script level may keep them from getting to see your content/use your services, but every time they try to access it, bandwidth and processing resources are used. They could still be free to for instance make a bot to stage a dns attack.
-
...well you don't really want to have them turned on. There's a reason why it's turned off by default now. And by php6 register globals won't even be supported. For a reason. They are evil. Every time someone uses register globals, a server somewhere crashes and a little piece of the internet dies.
-
php is parsed on the server. javascript is parsed on the client. php doesn't 'call' javascript. It simply spits out to your browser like any other text. Your browser decides what to do with it.
-
looks like your $this variable is empty.
-
that's javascript, not php. moving thread... p.s.- please use code tags when posting code.
-
Newbie - PHP form with a mail function() error.
.josh replied to betabr2005's topic in PHP Coding Help
bad params...did you echo out the variables you're trying to pass to mail() to see if they are holding what you expect? -
[SOLVED] function hyperlink () | Truncate anchortext?
.josh replied to Yves's topic in PHP Coding Help
Your function returns a string. Your script (some other piece that you didn't post) makes it into a link. You want to show only 40 chars of that link string, with a ... at the end of it. So you take the string that's returned from your function, display it in the href = '...', use substr() to show the short version of it between the anchor tags. I assume that this is what your code looks like (the principle, i'm not a mind reader): $string = hyperlink($somethingtoparse); echo "<a href = '$string'>$string</a>"; so change it to this: $string = hyperlink($somethingtoparse); echo "<a href = '$string'>". substr($string,0,40) . "...</a>"; -
I really don't know squat about linux but my shot in the dark is...does php.exe have permission to access gnome?
-
[SOLVED] function hyperlink () | Truncate anchortext?
.josh replied to Yves's topic in PHP Coding Help
example: <?php $string="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; $string = substr($string,0,40) . '...'; echo $string; ?> -
Sounds like you have a battle plan. So hop to it.
-
We have a sticky about hosts here. Thread Closed.
-
And I would just like to point out that unless you obfuscate your code to the point of no return, people can very easily remove that sort of stuff.
-
having other tabs on your browser will usually keep a session going. put unset($_SESSION); session_destroy(); at the end of your script.
-
http://images.google.com/imagelabeler/ It's fun AND productive
-
If you are not a dependent: http://www.irs.gov/publications/p54/ch01.html If you are a dependent: http://www.irs.gov/publications/p501/ar02.html#d0e536 Basically it depends on your filing status and your income. But it's quite a bit more than $32.
-
well the next thing I would do is put your echoes on 1 line or use heredoc for them.
-
if(($_SESSION['login'] == 1) && isset($_SESSION['Assessor'])){
-
But the error isn't in the same place, is it? Or can you not see that due to what you were saying before? If so, I think you should assume that that particular spot is no longer an issue. I suggest applying the HEREDOC to your other multi-line echo blocks.
-
I just want to point out that your code can be misleading. It could have executed the query just fine but mysql_affected_rows() could return 0 if the update didn't actually change anything. If you're just looking to find out if your query executed properly, your script already does that in the first place. You executed the query and if it failed, your die statement would give you an error.
-
well then I will point out that the call will return however many rows that were affected, and -1 if it fails.