
Zeggy
Members-
Posts
401 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by Zeggy
-
Re: [FAQ] How do I redirect users? (Location Header) Yep. It's probably because the code after the redirect is still being processed and sent to the browser.
-
Re: [Competition Questions] Designing Dynamic Tables Here's my go at this: <?php $links = array ( array('text' => "one", 'href' => "one.php"), array('text' => "two", 'href' => "two.php"), array('text' => "three", 'href' => "three.php"), array('text' => "four", 'href' => "four.php"), array('text' => "five", 'href' => "five.php"), array('text' => "six", 'href' => "six.php"), array('text' => "seven", 'href' => "seven.php"), array('text' => "eight", 'href' => "eight.php"), array('text' => "nine", 'href' => "nine.php"), array('text' => "ten", 'href' => "ten.php"), array('text' => "eleven", 'href' => "eleven.php"), array('text' => "twelve", 'href' => "twelve.php"), array('text' => "thirteen", 'href' => "thirteen.php"), ); $columns = (isset($_GET['columns']))?intval($_GET['columns']):4; $num_links = count($links); $left_over = (ceil($num_links / $columns) * $columns) - $num_links; $i = 0; echo "<table>\n"; foreach($links as $l) { echo (($i % $columns) == 0)?"<tr>\n":""; echo "<td><a href=\"" , $l['href'] , "\">" , $l['text'] , "</a></td>\n"; echo (($i % $columns) == ($columns-1))?"</tr>\n":""; if ($i == ($num_links-1)) { for($i2 = 0; $i2 < $left_over; $i2++) { echo "<td> </td>\n"; } echo "</tr>\n"; } $i++; } echo "</table>\n"; ?> I'll give the harder one a try, but I'll need to rewrite my code since I used foreach. btw, you should do more of these competitions. Gives me something to do, and it's interesting to see what other people come up with.
-
Re: [FAQ] How do I redirect users? (Location Header) Just a little footnote here: Don't forget to exit(); after your redirects.
-
Re: Hey everybody! btw, I'm still here :)
-
Re: 2D/3D MMORPG Engine Try this: http://www.playerworlds.com/
-
Re: Count Users Clicks lol, first of all, nice idea for a mod. I'd have called it number of pages viewed instead of clicks though, people might get the wrong idea and start clicking like mad on one page :D And you should stop being so aggressive. :)
-
Re: Securing Variables Yeah, but how the hell would I know what they chat about on MSN?
-
Update MySQL Table Using An Array
Zeggy replied to stryker's topic in MySQL, Oracle, Postgress or other DB
Re: Update MySQL Table Using An Array 1. Nice, thanks. 2. Care to show me some? 3. Thanks again. Seriously, what is your problem? Did I offend you? Am I wrong in what I said? Do you see subliminal messages from me insulting your mom? -
Re: Securing Variables It's not in this topic, so how would I know he posted that? I couldn't have known, so there was nothing wrong with my post. Right... care to show me where? I argue with your posts maybe, but I haven't made any personal attacks. So stop taking it personally.
-
Re: Securing Variables I'm sorry, can you tell me where you quoted that from? I'm fairly sure I didn't read that in this topic. Now, stop trying to argue with all my posts. It's not working :P
-
Update MySQL Table Using An Array
Zeggy replied to stryker's topic in MySQL, Oracle, Postgress or other DB
Re: Update MySQL Table Using An Array Haha, okay, but it's still as useless as before, as it can't update multiple columns in the same query. The original function could update multiple columns in the same query. That's what I meant by constructing the query. -
Update MySQL Table Using An Array
Zeggy replied to stryker's topic in MySQL, Oracle, Postgress or other DB
Re: Update MySQL Table Using An Array What do you mean, confuse myself? I'm not confused :) What I was saying was that your function using arrays isn't efficient at all. The original function that stryker posted was much better than the function you posted. -
Re: Securing Variables I think the easiest would be to just create/find a function that does this, then any time you need to clean a string, just run it through the function :)
-
Update MySQL Table Using An Array
Zeggy replied to stryker's topic in MySQL, Oracle, Postgress or other DB
Re: Update MySQL Table Using An Array And that is a very inefficient use of loops and database queries :) If you had ten elements in an array, there'd be 10 queries on that page. It would be better to construct the query in the loop, then run the query after it's done. -
Re: Anti-sql injection function Take out the dollar sign in front of cleaninput(). It's a function not a variable, and only variables start with a dollar sign.
-
Re: Fatal error: help please Well, why would you change it to $db->query? You'd only do that if you were using a library such as ADOdb that would connect to the database for you. Otherwise, just stick with the normal mySQL functions from PHP. Basically, that's saying $db isn't an object, so you can't run the query() function. Most likely, this is happening because: * $db doesn't exist * or query is wrong
-
buy hosting but cannot do cron job..what must i do?
Zeggy replied to nypthamine's topic in General Discussion
Re: buy hosting but cannot do cron job..what must i do? http://www.webcron.org Free cron service. -
Re: Anti-sql injection function Check for missing curly braces, mistakes in keywords. There is a typing error, as you posted the error yourself. You just gotta look hard enough :) Try getting a text editor with code highlighting, most typing errors should show up.
-
Re: Anti-sql injection function You have a spelling mistake :) Make sure you got a $ sign in front of all variables.
-
Re: Anti-sql injection function You could also use ADOdb, it automatically cleans your SQL queries :)
-
Re: How much is your site worth Your site is valued at: $3,859 Cool :) I never knew my site would be worth that much :P
-
Hello :) I'm Zeggy, and I'm a PHP coder. I've been running PHP games for a few years now, but none made with mccodes (I'm trying it out now!). I code all my games myself. I have a website that's also for browser-based games, and I am also coding my own game engine (links are in my sig). I'm glad to be a part of this community :D I've visited this site before, but I never joined until now.