Jump to content

pdtest

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pdtest's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Am trying to pass the command to another check in the script. The Variable is passed from the URL. . My issus is that when the Variable is matched, then I pass the command "eregi" to the next check in the script and that works fine. Now if the same variable does not match, then I send the command "!eregi" to the next check and that fails. Any ideas how to pass !eregi to the command and why does it fail ? <? $ans = "ftp"; echo $_GET['bg'] ; echo "<br>"; if ( eregi( 'ftp', $_GET['bg'] )) { $cmd = "eregi" ; echo "$cmd"; echo "<br>"; } else { $cmd = "!eregi" ; echo "$cmd"; echo "<br>"; } if ($cmd('ftp', $ans)) <--This is not working when $cmd is !eregi { echo "matched"; } else { echo "not matched"; } ?>
  2. No, I do not want the first value.....In fact $index is the variable being passed to this script and hence we are looking for the value in the array for that index.. Thanks
  3. Am trying to use Array in my PHP Script with foreach loop...... foreach ($ratiolist[$index] as $ratio_index=>$ratio_value) { $ratio=$ratio_value->ratio; echo "$ratio"; } This works fine and I get the value of ratio from the array..... Question: I do not want to use foreach loop and hence How can I extract the $ratio_value value ? I tried the following: $ratio=$ratiolist[$index] echo "$ratio"; Results: It says its an Array..... Any Suggestions ? Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.