RichardRotterdam
Members-
Posts
1,509 -
Joined
-
Last visited
Everything posted by RichardRotterdam
-
Your code could still product an error assume someone would have these values posted $birthyear ="some string"; $birthmonth ="some other string"; $birthday = "and yet another one"; that would result in $dob="some string-some other string-and yet another one"; once you insert or update that into the db that would produce an error if the field type would be a date or timestamp you could parse them all to integers or you could use a regex to validate if it is a valid date
-
Depends on a couple of things like what functionality you want. I would just play around with all of em and see which one I would prefer or you could start from scratch and build one yourself
-
a simple search would already give you a good description what it is. http://en.wikipedia.org/wiki/Entity-relationship_model
-
use date or timestamp. it will safe you the pain later if you need calculations
-
You can't place an image inside a <select> element use divs and javascript instead
-
this </html> te; if($_POST['submit']) { makes no sence at all it needs a php tag in front of if()
-
thats one looooooong if statement why not simply use the in_array function and put the building names in a array. If these buildings fetched from a database it would be even tiedier to use the id's $buildings=array(); $buildings[]="building1"; $buildings[]="building2"; $buildings[]="building3"; if(!in_array($building,$buildings)){ //error message stuff here }
-
People to test for security issues =)
RichardRotterdam replied to Twister1004's topic in Beta Test Your Stuff!
I see you run apache and php. You could disallow direct access for the files that give errors when requested directly. As for the get params. In your php only acces certain values. -
It doesn't make a developer look bad at all. You will still need to invest time to learn to working with a framework. Other then that you can develop javascript apps a lot faster without re-inventing the weel over and over again. In my opinion it just makes a developer just spend his/her time more efficient
-
i see your php vars are arrays. you could simply make php build a jsarray from your php array like so /** * Returns a jsArray in string format * @param array $array * @param string $name * @return string */ function jsArray($array,$name){ $jsArray="var {$name} = new Array();\n"; foreach($array as $key=>$val){ $jsArray.=(is_numeric($val))?"{$name}['{$key}']={$val};\n":"{$name}['{$key}']=\"{$val}\";\n"; } return $jsArray; } $langpack=array(); $langpack["title"]="some tite"; $langpack["error"]="some error"; $langpack["someothercrap"]="someothercrap"; echo jsArray($langpack,"jsarray");//this will be a jsarray
-
The way you are using you "pages" class almost looks like a DAO(data access object). Maybe you will find articles about DAO and ORM(object relation mapper) of interest
-
then you might want to look into dom xml http://nl2.php.net/manual/en/ref.domxml.php or you could search for a xml parser class or use regex
-
If you use phpMyAdmin why not use the mysql_* functions instead of odbc functions. That's what phpmyadmin does anyway. Or do you need to access a microsoft database?
-
You could start with putting yourself for hire on the freelance area of this forum.
-
Help Sorting multiple dimension arrays
RichardRotterdam replied to tran_dinh_ba's topic in PHP Coding Help
I read the word limit and records. Makes me think you are fetching it from a database. Are you using a database, if you are why not sort it before you put it in arrays? otherwise look into array_multisort http://nl.php.net/array_multisort -
look into simpleXML using php
-
you can use the odbc_* functions http://www.w3schools.com/PHP/php_db_odbc.asp I am not sure if this comes standard with PHP since I try to avoid using access. But you'll just have to try. Also you'll need a webserver like IIS or apache. One more thing what exactly is the .db format. Just because it has a .db behind the filename it could be anything. Is it Sqlite maybe?
-
Yes you can read an acces file with php. But why would you want to build a dbms in actionscript. if it is going to be a desktop application why not just simply use java c# c++ or flash just doesn't seem that suitable for it
-
how to run mysql queries in succession
RichardRotterdam replied to phplearner2008's topic in PHP Coding Help
Take a look at mysql's lock tables That or transactions -
if its never 0 then you could do if($row['kills'] <25 ){ } instead of ==0
-
use elseif $sql = mysql_query("SELECT * FROM table WHERE username = '$username'"); $row = mysql_fetch_array($sql); if($row['kills'] == 0){ echo '<center>Your not good enough to rank up yet!</center>'; }elseif($row['kills'] >= 25){ mysql_query("UPDATE `table` SET `variable` = 'new rank' WHERE username = '$username'") or die(mysql_error()); echo '<center>You have ranked up. '.$username.'</center>'; }elseif(){ //ETC }
-
In your login script, does echo $regid; give a value? The way you set the session seems right so thats pretty odd