trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
This topic has been moved to Editor Help (Dreamweaver, Zend, etc). http://www.phpfreaks.com/forums/index.php?topic=353683.0
-
This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=353684.0
-
This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=353645.0
-
Takes look at the manual foreach, you can referenc both values and keys easily.
-
Code is spitting out some retarded TITLE Array? Rofl
trq replied to Monkuar's topic in PHP Coding Help
Because array_shift returns the element it is shifting off. Still, You must be putting those values into $data prior to the code you posted. Try this: var_dump($data); $DB->query("SELECT g_title from ibf_groups where g_title NOT IN ('Validating','Guests') order by g_title"); while ($group = $DB->fetch_row()) { $data[] = $group['g_title']; } var_dump($data); -
As has been pointed out, your questions will be answered in the manual. Where to put your properties? That is more a style thing as php doesn't care. Everyone always declares them before any methods though. Iv'e not seen anyone do any differently.
-
Code is spitting out some retarded TITLE Array? Rofl
trq replied to Monkuar's topic in PHP Coding Help
You must be putting them into the $data array prior to this code. By the way, programming is an exact science. If anything goes wrong it is always human error. -
Nope.
-
It does the same thing as calling php's date() as you did but uses a mysql function instead. It doesn't. But it is a good habit to get into as it can come in handy when debugging.
-
This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=353620.0
-
This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=353630.0
-
This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=353621.0
-
The first thing that you should learn is about selectors. Your already using them in your example, but very inefficiently. Every time you use $('someselector') jQuery searches the DOM for that element, therefore, if your going to use the same element more than once, save it locally. $("#mydiv").click(function() { $myclass = $(".myclass"); if ($myclass.is(":hidden")) { $myclass.slideDown("slow"); } else { $myclass.slideUp("slow"); } });
-
PHP_SELF and SCRIPT_NAME are out of the equation because they don't go close to providing the data that you need. As for a consensus, I'm not sure there is any. Simple frameworks will likely only use REQUEST_URI as it is generally reliable, however, something more robust will check for various server specific variables such as X_REWRITE_URL and UNENCODED_URL before falling back to REQUEST_URI and then finally ORIG_PATH_INFO. I'm in the process of writing a framework myself and decided to go down the simple REQUEST_URI path for now. I figure I can always add more checks latter if need be but for now REQUEST_URI is perfectly reliable.
-
I'm pretty sure... if (isset($_GET['404'])) { works in that situation as well.
-
Thats all you require using MVC as all requests are made to index.php and handled by the dispatcher. You only require the query string to load the appropriate objects. $_REQUEST contains all reserved variables as you have stated. I think there is still some confusion here, probably generated from this: Given the url http://www.yourwebsite.com/blog/latest/a, $_SERVER['QUERY_STRING'] will be empty, /blog/latest/a will show up in $_SERVER['REQUEST_URI'] which is (in simple terms) what most MVC's pass to the router for processing before handing the results to the dispatcher.
-
The error you are getting is because you are passing the result from a call to mysql_query to another call to mysql_query. The reason I said your code made little sense is because of these two lines. foreach ($result as $hit_id => $value){ if($result[$hit_id] == $value); $result[$hit_id] will always equal $value. Unfortunately however, I still don't understand your explanation well enough to understand what it is your doing.
-
Your forgot to describe your problem and your code makes little sense.
-
Need help with PHP post installation
trq replied to ahmoo's topic in PHP Installation and Configuration
I'm not a windows user but i'm certain the recommended install method is via a manual install using the zip not the installer. -
Need help with PHP post installation
trq replied to ahmoo's topic in PHP Installation and Configuration
You haven't mentioned what OS, what server or the steps taken. -
This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=353495.0
-
Your missing the entire point of a 'dynamic website'. Do you think we need to copy files around every time we add a new board to these forums? Better still, do you think a new page is created every time someone asks a new question? No. Store your data in a database and you can use the same page over and over.
-
Why are you trying to do this in the first place? It makes little sense to have multiple copies of essentially the same file.
-
This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=353490.0
-
This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=353485.0