-
Posts
1,033 -
Joined
-
Last visited
-
Days Won
17
Everything posted by gw1500se
-
how to send two values in two form field with ajax
gw1500se replied to mahenda's topic in Javascript Help
What did you try? What did not work or what error message did you get? Its impossible to help you if you don't show us your code. -
This is what you need.
-
That result is parsable but I suspect that is not really your question. Are you asking why it is returning false? If so that is a function of the SOAP request not a parsing issue. You need to clarify what you are doing/asking.
-
First, please use the code icon (<>) for your code and specify PHP. As for your specific problem, you are not checking for errors. Make sure you use error_reporting(E_ALL); at the beginning of the script to debug. You probably need to use a try/catch for your production version to handle errors.
-
You need to echo $visitsneeded and $read to see what they really are.
-
And the other (5609) apparently was visited enough.
-
How do you know it is not going to the next value? You don't echo anything if there is a match.
-
Yes but the order may not be what you expect. Do the following after the first loop to debug it echo "<pre>"; print_r($rifdid); echo "</pre>" Then echo $key just before the 'if': I am guessing the order is not what you expect so you may need to use the 2nd 'if' statement.
-
Use an array for $firdid In the first loop: i=0; foreach(findCustomAlerts($customerid) as $key=>$value){ echo "ID of cat : ".$rifdid[$i++] = $value['Catid']."<br>"; Then use that in the other loop: i=0; foreach($rfid as $key=> $read){ if($key ==$rifdid[$i++] && $read < $visitsneeded) { This assumes $value will result in $rifdid being in the same order as $rfid. If it is not then you will need to search the array to see if that key is in it. See array_search. if(array_search($key,$rifdid) && $read < $visitsneeded) {
-
First please use the code icon (<>) for you code and specify PHP. The formatter makes your code much easier to read. The problem, I believe, is $rifdid. Notice that you only set that variable in the first foreach loop. So when you use it in the if block, it will always have the same value. That value is whatever it was set to on the last pass of the first foreach loop. It seems unlikely that is what you really want.
-
'$checkboxvalue' will never be 'empty'. It is a boolean value. If you want to know if none of the boxes are checked then use '!$checkboxvalue' in the 'if' statement.
-
Blocking IP addresses listed on external sites
gw1500se replied to ajetrumpet's topic in PHP Coding Help
Probably a waste of time. If users with those IPs use a VPN you won't know where they are coming from anyway. If you properly harden your server and pages you don't have to worry much about hackers. If you want to keep certain users off your web site then use a login page and vet the user before permitting access. -
Since you have multiple queries, you don't indicate what 'it' is. Which query is returning the bogus data? As an aside you should not use '*' in a select. List only those columns you actually intend to use.
-
Add this before the 'foreach' to make sure it does what you expect. echo "<pre>"; print_r(range( 0, $datediff )); echo "</pre>"; The errors are likely related. Which lines are 661 and 670?
-
Do you mean myPHPadmin for MySQL? What is wrong with the standard one?
-
Perhaps the OP is confusing server side (PHP) stateless operation vs client side (javascript) operation.
-
I'm not following what you want to do. You say you want the page to reload without clicking the submit button. That is what it is doing which makes no sense. There must be some condition, you did not explain, that will cause a reload without the submit button.
-
Generate JSON structure from array of items
gw1500se replied to frontEndCoder's topic in PHP Coding Help
You can use json_encode to do the conversion. It would be easier to restructure your array so it can be json encoded. -
No, you should change the sudoers file to allow user apache to run that command. However, before you get yourself in trouble, please explain why you need web users to run restricted commands. Perhaps we can come up with a safer alternative.
-
While you are playing with fire giving users access to a root command, the sudoers file needs the user running the script. It is probably 'apache'.
-
What does "doesn't seem to work" mean?
-
$_SESSION data is stored on the server. If you run 'phpinfo()' and look for the variable 'session.save_path' you can see exactly where it is. Cookies, on the other hand, are stored on the client.
-
Cards are formatted with CSS so this is not really a PHP question. Perhaps this example is what you are looking for.
-
Did you add a form to enclose your submit button? Show your HTML.
-
Yes, you need to learn form handling.