Search found 15 matches

by Lostnode
Sat Aug 07, 2010 3:07 pm
Forum: PHP - Code
Topic: Need help with mutile arrays and if statements
Replies: 6
Views: 670

Re: Need help with mutile arrays and if statements

Sound's like a plan, never used glob(), however theoretically this should work right?

Code: Select all

<?php
foreach (glob("../admin/modules/*") as $incdir) {
if (file_exists('../admin/modules/$incdir/array.php")) {
    include('../admin/modules/$incdir/array.php');
}
}
?>
by Lostnode
Wed Aug 04, 2010 6:59 pm
Forum: PHP - Code
Topic: Need help with mutile arrays and if statements
Replies: 6
Views: 670

Re: Need help with mutile arrays and if statements

That would work, if I only had the one module, I was looking into this, however on a larger scale, say I had 10 possible modules, how would I write it assuming that not all 10 may exist? it would be so much easier if there was a array_inject() function that would allow me to inject them all in (if t...
by Lostnode
Wed Aug 04, 2010 6:14 pm
Forum: PHP - Code
Topic: Need help with mutile arrays and if statements
Replies: 6
Views: 670

Need help with mutile arrays and if statements

Ok, not sure if the topic is as descriptive as it should be, let alone how to describe my situation. Lets take a look at my code snipet first. $pages = array('employees' => '/admin/content/employees.php', 'emp-add' => '/admin/content/emp-add.php', 'emp-added' => '/admin/content/emp-added.php', 'emp-...
by Lostnode
Thu Oct 13, 2005 5:01 pm
Forum: PHP - Code
Topic: PHP not keeping variables
Replies: 20
Views: 1740

Ok..... works now.... dunno how....
by Lostnode
Thu Oct 13, 2005 4:59 pm
Forum: PHP - Code
Topic: PHP not keeping variables
Replies: 20
Views: 1740

Burrito wrote:

Code: Select all

<?
print_r($_GET);
?>
8O
Meh... Ok...

I also tried

Code: Select all

print $_GET['cntry']
and it came out with the right values.
by Lostnode
Thu Oct 13, 2005 4:55 pm
Forum: PHP - Code
Topic: PHP not keeping variables
Replies: 20
Views: 1740

Ok, here is what I get when I print_r my $_GET['cntry']

Code: Select all

parse error: parse error, unexpected T_VARIABLE in /home/un/public_html/channels/index.php on line 11
by Lostnode
Thu Oct 13, 2005 4:48 pm
Forum: PHP - Code
Topic: PHP not keeping variables
Replies: 20
Views: 1740

lose the quotes $cntry = $_GET['cntry']; if ( $cntry == '' ) //This is line 12, and its 2 x ' not " { echo "Please select a country<br><p>"; } damn it, either you edited or I missed it :P anyway, try print_r'ing your $_GET[] array to see what it shows... Yeah I edited after I realize...
by Lostnode
Thu Oct 13, 2005 4:42 pm
Forum: PHP - Code
Topic: PHP not keeping variables
Replies: 20
Views: 1740

Ok, didn;t work... I still get this error when ever I use $_GET Parse error: parse error, unexpected T_IF in /home/un/public_html/channels/index.php on line 12 $cntry ="$_GET['cntry']" if ( $cntry == '' ) //This is line 12, and its 2 x ' not " { echo "Please select a country<br><...
by Lostnode
Thu Oct 13, 2005 4:33 pm
Forum: PHP - Code
Topic: PHP not keeping variables
Replies: 20
Views: 1740

Ah, my appologies... Misread it... Ok, I will use a single quote. Thnx
by Lostnode
Thu Oct 13, 2005 4:30 pm
Forum: PHP - Code
Topic: PHP not keeping variables
Replies: 20
Views: 1740

Burrito wrote:no just a single equal....you're not comparing you're setting
You must have a very hires screen Burrito... It is a double equal sign... :)
Thank you for the help, I will see what I can do about it.
by Lostnode
Thu Oct 13, 2005 4:23 pm
Forum: PHP - Code
Topic: PHP not keeping variables
Replies: 20
Views: 1740

Burrito wrote:for the sake of ease you might want to just set $ctnry to $_GET['cntry'], then you wont' have to change anything else.
You mean

Code: Select all

$cntry == $_GET['cntry']
?
by Lostnode
Thu Oct 13, 2005 3:49 pm
Forum: PHP - Code
Topic: PHP not keeping variables
Replies: 20
Views: 1740

Burrito wrote:GET needs to be all caps:

ie:

Code: Select all

$_GET['whatever']
It was in my code (llok at the code, not what I wrote by hand)

It as the register globals, but how do I gode it with the $_GET? It wasn;t working at all.
by Lostnode
Thu Oct 13, 2005 3:34 pm
Forum: PHP - Code
Topic: PHP not keeping variables
Replies: 20
Views: 1740

When I use $_Get['cntry'] I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/un/public_html/channels/index2.php on line 52 Line 52, and every otehr MySQL Query looks like this: $query = "SELECT channel,age,...
by Lostnode
Thu Oct 13, 2005 3:24 pm
Forum: PHP - Code
Topic: PHP not keeping variables
Replies: 20
Views: 1740

That doesnt work either. SInce I cannot post attachements, I will post the whole code and hope it fits. <!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head> <title>Distrobution</title> <link href="/umm.css" rel="stylesheet" type="text/css"> </head>...
by Lostnode
Thu Oct 13, 2005 1:44 am
Forum: PHP - Code
Topic: PHP not keeping variables
Replies: 20
Views: 1740

PHP not keeping variables

I had created a piece of PHP Code for a client, that basicalt took infor from MySQL, all that works, but PHP is not keeping a variable. I have this code at the begining if( $cntry == '' ) { echo "Please select a country<br><p>"; } Which basicaly states, until you define cntry, place this t...