Jump to content

mrherman

Members
  • Posts

    158
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

mrherman's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. YESSSS!!! That was it!! Thanks for this information. Now everything works! Happy, happy!!
  2. Thanks, guys! Extract() is not working because the array contains various functions. When the array is extract-ed, it echos back the function calls, not the values that they should derive. For example, after extract(), the values are: function trace_log( $a_log ) { if (is_array($a_log)) { extract($a_log); } echo $file . "<br />"; echo $script . "<br />"; echo $func . "<br />"; echo $line . "<br />"; echo $var_name . "<br />"; echo $var_value . "<br />"; ........ Prints out: Notice: Undefined variable: file in E:\Web\HTDOCS\Learnweb\Register_login\includes\inc_functions.php on line 75 script_name() __FUNCTION__ __LINE__ var_name() var_value() As for serialize(), I'm not clear as to how that would be helpful.
  3. I've spent a lot of time on this, thinking I could figure it out, but I'm royally stuck. I have a "debugging" helper function that I call when I need to know what is happening to a variable. The results of the call are inserted into a table, which I then review for problems. Here is an earlier version of my function call to "trace_log()." It worked fine. trace_log( file_name(__FILE__), script_name(), __FUNCTION__, __LINE__, var_name(), var_value()); Now I want to put the function call parameters into an array. Here is my code: $myarray = array( 'myfile' => 'file_name(__FILE__)', 'script' => 'script_name()', 'func' => '__FUNCTION__', 'line' => '__LINE__', 'var_name' => 'var_name()', 'var_value' => 'var_value()' ); Note that script_name(), var_name(), and var_value() are user defined functions. Now, I am trying to make the parameters in $myarray work within the function, but I have not been successful. Here is how I think the code should begin: function trace_log( $myarray ) { /* Connect to db */ if( is_array( $myarray ) ) { foreach( $myarray as $k => $v ) { ... !!!!! CAN'T GET PAST THIS POINT !!!!! Here is the code I use in the function "trace_log()" to insert the items into a table: $sql = "INSERT INTO reg_log_trace( step, file, script, func, line, var_name, var_value ) VALUES ( 0,'{$file}','{$script}','{$func}', {$line}, '{$var_name}', '{$var_value}' )"; How can I resolve this? Thanks for the help!
  4. Thanks! That's what I was thinking, but I wanted to make sure.
  5. Hi -- I have a debugging function that called like this trace_log( file_name(__FILE__), script_name(), __FUNCTION__, __LINE__, var_name(), var_value()); As I use it many times within a script, is there a way to group the parameters in a variable or constant in order to make the line of code less cumbersome? I know the following won't work, but to give an example of what I mean: $paramList= "file_name(__FILE__), script_name(), __FUNCTION__, __LINE__, var_name(), var_value()"; trace_log( $paramList ); Thanks!
  6. Well, actually, in reality I'm not. See, none of my "variable links" were working -- form, redirection, etc. -- and I couldn't figure it out. So, to illustrate my error on the forum, I just copied and posted a link, which happened to be a reference to the CSS file. I didn't even notice that I had done this. Good catch!
  7. Well, thank you very much! I tried everything BUT that!
  8. This works: form action="http://localhost/mysite/css/screen.css" method="post"> This does not work: <?php $link_1 = "http://localhost/mysite/css/screen.css" ; $link_2 = '"' . "http://localhost/mysite/css/screen.css" .'"' ; ?> <form action=<?php echo $link_1;?> method="post"> <form action=<?php echo $link_2;?> method="post"> Why do neither of the PHP variables work? Thanks!
  9. Every time I see it on the screen, there is an error. So, to me it means Trouble.
  10. Ah, so it stands for token. Thanks for the pointer. I read some more about this (http://en.wikipedia.org/wiki/Lexical_analysis) and it is a pretty complicated subject.
  11. Just curious. Why the term "T_STRING?" Looked it up, but all I could find was that it is a very small pair of underwear.
  12. Hello -- Other than organizational clarity for the developer, is there a particular advantage (e.g., security, file access speed, etc.) for placing web files (php, css, html, etc.) in various folders and sub-folders vs placing all files in the root directory or in one particular folder? Thanks.
  13. Yes, I meant the variable name. Thanks for the answer.
  14. I did a phpfreaks search for this, but didn't find anything specific. How can I echo out an array name? I have a function to return the array contents (for debugging purposes), and I need it to generate the actual name of the array as well. 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.