-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
There was an extra ( in my sample code. If you had turned on php error checking you probably would have been informed of it.
-
Dom is great if you are using JS to modify the current page in real-time. But from a PHP script that is literally building a webpage, there is no need to do things the hard way. Just echo out the html you need.
-
Well the anchor tags are the natural way to do it. How else are you going to generate a click? As for your concern about resource usage - a simple glob will tell you what the contents of a dir are and how many entries there are so what is the concern? As for the 'complex structure' you are only going to load one dir for a click - any dirs below that one will still show up as anchor tags with no details beneath them - yet.
-
Restrict field values to either 1 or 0 in PHP
ginerjm replied to VanityCrush's topic in PHP Coding Help
Checking if $_POST is empty is a pretty meaningless check. What are you hoping it will tell you? Upon receiving posted input one usually checks for the button value that was checked and then proceeds to handle the input data that that button should be providing. You're checking if there is anything at all in $_POST and then immediately proceeding to use the input provided without checking if all (or any) of the inputs are valid or even present. As for your first statement that Cronix disputed - it seems correct to me. You ask if 'active' is NOT 1 and if 'active' is NOT 0 and if true you prepare an error message. Seems valid to me! -
Is there some reason behind using dom to build your page instead of just echo'ing the html you need to display this? And why does it have to be ajax? As for the clickable things - output your list elements as simple text values but when one of them is a directory name output it as an anchor tag inside of a list element.
-
As mentioned before - you REALLY need to read something to learn about PHP. Your last code sample is still a MESS. Two opening form tags, but only one closing one that I can see. You've invested an awful lot of time in layout but very little in designing the simple mechanics of html and form input handling. 1 - Turn on php error checking. It will help you. (See my signature) 2 - Hint - there is no such variable as $_post. A little bit of php knowledge will teach you that. 3 - Proper array syntax is $variable['index'] which you are not doing. 4 - You are doing a form POST so why the use of (incorrect) $_get references? If my question puzzle you and make you think that I'm being unfair, consider it your first lesson in how to learn to program. You think this is easy? It CAN be -if you do your homework.
-
Untested but s/b pretty close. $site= (dns_get_record( "example.com", DNS_ALL); ShowArray($site); //*********************** function ShowArray($arg) { foreach ($arg as $idx=>$val) { if (is_array($var)) { echo "<br>Array is<br>"; ShowArray($var); } else echo "$idx is $val<br>"; } }
-
Did you fix the problems I pointed out? When you do how about isolating the new problem area(s) and posting those snippets of code for us to address? I, for one, will not be going to your external post no matter where it is hosted, so I won't be any help until you do the necessary work to get close to your problem and ask a pertinent question.
-
echo "<textarea name='txtbox' cols=60 row=9>",print_r($array,true),"</textarea>"; OR do you mean simply to display it as text? echo "<p>",print_r($array,true),"</p>";
-
1 - you are using $_POST in your code but since your form doesn't have a method set the $_POST array won't have your inputs 2 - You also reference an input name of 'submit' but I don't see that in your form 3 - I don't see where you included the class so that could certainly explain your new error now as well as the above two items. 4 - add php error checking to help you debug what will probably be many future errors. See my signature.
-
Look at those lines. You are referencing an element of an array that does not exist. That you must figure out yourself. YOu could do a var_dump before trying to use any of that array to see what indices you DO have in there.
-
Perhaps you could point out the line that is giving you the error message since line 99 in your post is blank. No need to get indignant - you were simply asked for a more complete details to help solve your dilemma. PS - if you removed all the uses of session_register, what did you replace them with? Perhaps you could post your revised code - specifically the area where you are having the problem?
-
Reading is a real talent. Here's what one would read as soon as they referenced the manual: glob — Find pathnames matching a pattern Description array glob ( string $pattern [, int $flags = 0 ] ) The glob() function searches for all the pathnames matching pattern according to the rules used by the libc glob() function, which is similar to the rules used by common shells. Also - if you scrolled down thru the examples you would find #6 from Alan.... that describes a pretty nifty function he wrote to do what you are possibly looking to do. No charge for the research.
-
Specify the path in the arguments to the glob call. Read the manual?
-
And it supports PHP and allows you to modify the .ini file? (Remember - you get what you pay for.)
-
That is for you to find out. And once you do, start writing the code to do what you want to do. And then when you have a problem the forum is here to help you out - if you can't get help from the 'magic' people or the 'orchard' people
-
And this "orchard content management system" - you have the api for it and you have read up on how to use it, so that you can write your php code to do your thing?
-
Your question is confusing. If you are using the same server for the same user? As opposed to what? And why do you care how the session is managed? Php will handle it for you unless you have written something to replace standard session handling.
-
If you look at an html reference you will see that the image tag has a "title" attribute.
-
You could pass a JSON array of that stuff to the js code in the webpage when your php builds the page. Then it's simply a js function called by an event on the dropdown box.
-
Initialize it at the start of your function?
-
The standard html img tag attributes don't work for you?
-
Hmmm.... Barand gave you back the same url that you referenced which you said you were happy with except for the part concerning retrieving the data into your script. Now you say it doesn't give you what you need. Is it simply a matter of culling a different field from the decoded data? Do a var_dump on the data and see what it contains and use it.
-
You have to provide a unique value for your options otherwise whatever is clicked will return the same value "first name:". When a select tag is setup properly the $_POST array will return something as $_POST['first_name'] which will match one of the values you specify in one of the option tags. No matter which item is selected currently you will get back "first name:" every time.