[PHP] Why this doesn't work ?

2005-10-24 Thread Scott Noyes
> $query = "SELECT COUNT (login) FROM formacao WHERE login = '$login'"; > $result = mysql_query($query); Make this line instead $result = mysql_query($query) or die(mysql_error() . " with the query $query"; and you'll likely see the error. -- Scott Noyes

Re: [PHP] __FILE__ and __LINE__ of calling scripts?

2005-09-27 Thread Scott Noyes
> I want to find out if it is possible to get the file name and the line > number of a calling script (__FILE__, __LINE_) from a calling class > automatically. debug_backtrace contains that info. http://www.php.net/debug_backtrace -- Scott Noyes [EMAIL PROTECTED] -- PHP General Mai

Re: [PHP] Is PHP the language for me???

2005-09-23 Thread Scott Noyes
;niceness' onto a webpage so as > they can be used as links to the files. PHP is capable of doing that. I'd start with the dir() function, and maybe a bit of printf. http://www.php.net/dir http://www.php.net/printf -- Scott Noyes [EMAIL PROTECTED] -- PHP General Mailing List (http:

Re: [PHP] Retrieving variable name?

2005-09-22 Thread Scott Noyes
> Sure. Use debug_backtrace to figure out what line and what file the > caller is in, then read that file, find that line, find the function > call within that line, and read what ever is between the parentheses. Something like this: -- PHP General Mailing List (http://www.php.net/) To unsubsc

Re: [PHP] Retrieving variable name?

2005-09-21 Thread Scott Noyes
> is it possible to retrieve the name of a variable passed into a > function from within the function? Sure. Use debug_backtrace to figure out what line and what file the caller is in, then read that file, find that line, find the function call within that line, and read what ever is between the

Re: [PHP] Perhaps a stupid question on phpinfo

2005-09-16 Thread Scott Noyes
> $mypath = "C:/phptestdir/"; > $file = "phpinfo.htm"; > $html_file = fopen("$mypath$file", "w"); > fwrite ($html_file, printf(phpinfo())); > fclose ($html_file); > > How would I accomplish this? ob_start(); phpinfo(); $content = ob_get_clean(); fwrite($html_file, $content); -- PHP General Maili

Re: [PHP] html forms in php

2005-09-16 Thread Scott Noyes
> "Are you sure?" and then a "yes" and "no" buttons to confirm the deletion or > to cancel the command. > > Any thougts?? While some of the others here have answered your technical question, I'd like to state my opinion on usability. I HATE "Are you sure?" prompts. If I wasn't sure, I wouldn't

Re: [PHP] Re: trying to figure out the best/efficient way to tell whois logged into a site..

2005-09-14 Thread Scott Noyes
> Suppose you have a form that posts set hidden values. A malicious user > could modify the URI to change those values. A malicious user could just as easily modify the http header that sets the POST, or the cookie that sets the COOKIE, or whatever. In other words, if it comes from the user, it

Re: [PHP] Inserting records question

2005-09-08 Thread Scott Noyes
> mysql_connect(localhost,$username,$password); > @mysql_select_db("$database") or die("Unable to Connect to > DB"); > $tc_query = "INSERT INTO $tablel VALUES(NULL, $lname, $fname, > $machine_name, > $email_addr, $problem, NULL)"; >

Re: [PHP] Bug??

2005-08-30 Thread Scott Noyes
> for($i=1;$i<13;$i++) { > echo $i . " :: "; > echo date('F', mktime(0, 0, 0, $i)) . " :: "; > echo mktime(0, 0, 0, $i) . "\n"; > } > > > 1 :: January :: 1107061200 > 2 :: March :: 1109739600 > 3 :: March :: 1112158800 Today is the 30th (in some parts of the world, anyway

Re: [PHP] ZCE Reccommendations

2005-08-30 Thread Scott Noyes
> I'm taking my ZCE exam soon and would like general advice on what to > study up on. I've been using php since 97 so I'm pretty confident with > day-today stuff, but I'm pretty new to OOP and and looking for any study > pointers I can get. Remember that the ZCE still uses PHP 4. Classes and obje

Re: [PHP] formatting problems:

2005-08-16 Thread Scott Noyes
It's not clear to me how strict you want to be regarding the formatting. Are you trying to keep scenes together on each line, or just dump everything and let it wrap where it needs to? Perhaps you could handcode a sample and post a link. I'd also guess that you could make good use of CSS, specif

Re: [PHP] Trying to figure out contents stored in db field

2005-08-14 Thread Scott Noyes
Unserialize it, and then use var_dump() to see what the object contains: var_dump(unserialize($location_data)); On 8/14/05, Gregory Machin <[EMAIL PROTECTED]> wrote: > Hi > The cms exponent story some data in a serialized array .. > then column name id location_data and contains the following.. >

Re: [PHP] possible bug (string equality to zero)?

2005-08-11 Thread Scott Noyes
> [snip] > Is it a bug that ($var == 0) is always true for any string $var? > [/snip] > > You are comparing a string to an integer. Right. This is clearly documented at http://www.php.net/operators.comparison -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.ph