Re: [PHP] mysql_num_rows

2002-11-21 Thread Sascha Cunz
Hi, > 39| $result=mysql_query("slecet * from site_members where > User_Name='$username'"); 40| $num_row=mysql_num_rows($result); > 41| if($num_row>0) echo("error 46"); There is an typo-error in the word "slecet" which shoud look like "select" :-) -Sascha -- PHP General Mailing List (htt

Re: [PHP] $_SESSION question

2002-11-14 Thread Sascha Cunz
Hi Jochen, > How can I process $_SESSION variables if the user disables cookies > and session.use_trans_sid = 0 ? You could use a combination of outputbuffering and a self-written session-handler. So you could build a trans_sid-alike system, that would do more checks (i.e. compare IP-Addresses)

Re: [PHP] $_SESSION question

2002-11-14 Thread Sascha Cunz
> Simply put - you can't. > > You need a way to transmit the session identifier, and AFAIK there's > nothing except either cookies or SID. > > Using SID for security relevant issues presents a problem - users can send > links with a SID to friends by mail or else, so this is not really a secure > s

Re: [PHP] Subtracting Money

2002-11-14 Thread Sascha Cunz
Hi Stephen, > I'm having a problem. I need to subtract money, but if they type in an > ammount such as $2.30 and I subtract $0.20, instead of returning $2.10 like > it should, it returns $2.1. How can I fix this keeping in mind that other > variable could be $2.40 or $100.30 and so on...? This is

Re: [PHP] php.ini

2002-11-08 Thread Sascha Cunz
> The easiest way to find out where PHP expects your php.ini to be is to > create a page that calls phpinfo() - the configuration file location is > near the top of the output. Just to mention this: phpinfo() outputs the exact file name, if it loaded a php.ini - and outputs the path, where it tho

Re: [PHP] Am I blind? simple 15 line code producing error

2002-11-03 Thread Sascha Cunz
require's, just to be sure? btw: $HTTP_SESSION_VARS[user_id] should really be $HTTP_SESSION_VARS['user_id'] -Sascha > > -Original Message- > From: Sascha Cunz [mailto:Sascha@;GaNoAn.org] > Sent: Sunday, November 03, 2002 1:03 PM > To: Paul; [EMAIL PROTECTED] &

Re: [PHP] Am I blind? simple 15 line code producing error

2002-11-03 Thread Sascha Cunz
> require_once ("config.inc"); > require_once "classes/HtmlTemplate.class"; > The error is: > Warning: Cannot add header information - headers already sent by (output > started by.. ..line 6) ...on line 12 > > Line 6 is the line with if ($HTTP_SESSION_VARS[user_id]) > L

Re: [PHP] Saving form input fields to MySQL br clicking on a button

2002-10-31 Thread Sascha Cunz
Hi, > Hi, > > I have a form where the user enters some information. For a particular > section of the form, I'd like the user to be able to save what he/she > entered so that the next time they feel out the form, they can recall > without the need to retype. This is not for the entire form but o

Re: [PHP] Variable over url

2002-10-31 Thread Sascha Cunz
Ops, of course. Sascha Am Donnerstag, 31. Oktober 2002 04:07 schrieb Chris Shiflett: > I think you mean turn on register_globals. :-) > > Sascha Cunz wrote: > >try > > > echo $_GET['tmp']; > >?> > > > >or turn off register_globals in your p

Re: [PHP] Variable over url

2002-10-30 Thread Sascha Cunz
Hi, try or turn off register_globals in your php.ini file. - Sascha Am Mittwoch, 30. Oktober 2002 20:49 schrieb Manuel Jenne: > Hi, > > I've just installed php 4.2.3 and wonder why I can't submit an variable > over url. > > Example: > > My Script: > Test.php > > echo $tmp; > ?> > > My URL: >

Re: [PHP] Re: POST-ing or GET-ing an array

2002-10-29 Thread Sascha Cunz
Hi, > I disagree that serialize/unserialize is the way to go, unless you're > absolutely completely sure that there will only be a relatively small > number of things in the array. As somebody mentioned briefly, the get > request is limited to a certain number of bytes, and the string > represent

Re: [PHP] POST-ing or GET-ing an array

2002-10-29 Thread Sascha Cunz
> Hey, > I think you should be able to serialize and urlencode the array and then > pass that via get/post.post would be a lot better as get is limited to > so many chars. Something like: > $sql = "select stuff from my_table"; > $result = mysql_query($sql); > while ($myrow = mysql_fetch_assoc($

Re: [PHP] POST-ing or GET-ing an array

2002-10-29 Thread Sascha Cunz
Hi, first of all, i would prefer to do this task in a session-variable (less traffic, less security holes). But, if you're sure you need to pass the array via an URL, try: which will result in test.php called with $_GET['ary'] containing: [0] = '1' [1] = '2' If the array contains strings (a

Re: [PHP] "global" AND Register Globals with PHP 4.0.6 ??

2002-10-14 Thread Sascha Cunz
Am Montag, 14. Oktober 2002 16:51 schrieb Negretti, John (CCI-San Diego): > Hello, > > I need to access the "$HTTP_GET_VARS" and "$HTTP_COOKIE_VARS" arrays > within a function. In order to do this I have to pass $HTTP_GET_VARS as a > parameter of the function. How can I access these built-

Re: [PHP] $HTTP_GET_VARS within a function ??

2002-10-14 Thread Sascha Cunz
http://localhost/test.php?var=5 results in (global scope) $var = 5; // Register globals on $HTTP_GET_VARS['var'] = 5; // Always (?) $_GET['var'] = 5; // With newer versions of PHP To access this from a function: function x() { global $var; globsl $HTTP_GET_VARS; echo $var.''; e

Re: [PHP] Simple HTML-Form Question

2002-10-13 Thread Sascha Cunz
This beautifies it (even makes it a bit more secure), but one doesn't need it really; should have worked without these changes, too. (Of course, it's better to include these changes) Sascha > The value of name for the submit button is wrong - it should be the same > as the value you gave the i

Re: [PHP] Simple HTML-Form Question

2002-10-13 Thread Sascha Cunz
register_globals defaults now to off. Use the superglobals instead. "; } ?> Sascha Am Sonntag, 13. Oktober 2002 23:40 schrieb Lars H. Korte: > Hi, > I've updated to PHP 4.2.3 and wrote this simple Script: > > if (isset($name)) { > echo "Hallo $name"; > } > else { > echo " >

Re: [PHP] Fatal error: Maximum execution time of 30 seconds exceeded

2002-10-13 Thread Sascha Cunz
Yet another very fine way to do this job, is to set up a mailinglist manager (ezmlm i.e.), whom you subscribe all your recipients - And then send just one mail to the mailinglist manager. Of course, works only if you got control to the server. --Sascha -- PHP General Mailing List (http://www.

Re: [PHP] POST and GET variables don't work

2002-10-13 Thread Sascha Cunz
Am Sonntag, 13. Oktober 2002 02:11 schrieb Andres Olarte: > Thanks to Oscar and Jennifer, it's working now. I did a bit of reading, > and it seems it's not recommend to enable "register_globlas", why is that? For security... Imagine, you register a session variable to contain the user's ID. Any

Re: [PHP] Predefined variables not set?

2002-10-13 Thread Sascha Cunz
Am Sonntag, 13. Oktober 2002 10:04 schrieb Miles: > When trying to get $_SERVER["QUERY_STRING"] I am getting 'Undefined index > QUERY_STRING' error > > If there is a query string, e.g. www.site.com/index.php?hello_world then > it IS defined. So it seems that PHP is complaining about undefined >

Re: [PHP] Upload Problem

2002-10-13 Thread Sascha Cunz
Hi, as far as i can follow you, you want to: 1. copy a file from position a to position b. 2. read it from position b. 3. and delete it at position b. Why not read it directly from position a? So what about: $content = implode("", file($userfile)); Anyway: You should initialize $i in any

Re: [PHP] Calling PHP (cgi) from a perl script and passsing parameters

2002-10-10 Thread Sascha Cunz
What you're referring is CLI, not CGI Version of PHP. Anyway, i assume, you're using a PHP version 4.2 or higher. Have a look at the $_SERVER['argc'] and $_SERVER['argv']. Sascha Am Donnerstag, 10. Oktober 2002 23:57 schrieb Jim Carey: > Hi, > > have been having problems passing parameters to

Re: [PHP] php.net bug system

2002-10-08 Thread Sascha Cunz
sure, it is :-) Try: http://cvs.php.net/cvs.php/php-bugs-web?login=2 or go to: http://www.php.net/anoncvs.php and check out "php-bugs-web" Happy Hacking (I'd personally prefer bugzilla... You won't need to adjust as much) Sascha Am Mittwoch, 9. Oktober 2002 02:52 schrieb Jason Morehouse: > A

Re: [PHP] HTTP_USER_AGENT - list of possibilities

2002-10-08 Thread Sascha Cunz
Hi, > Hey everyone... do you know where I can find a list of the common returns > of the $_SERVER["HTTP_USER_AGENT"] variable? > > For example: > I.E. 5.0 = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; .NET CLR > 1.0.3705) > Netscape 4.08 = Mozilla/4.08 [en] (WinNT; U ;Nav) On one side -

Re: [PHP] getimagesize or loop pblm

2002-10-06 Thread Sascha Cunz
You can calculate the image size when adding the image (rather than when displaying it) and store the information in a file or a database. This file or database you could use for posting the right sizes for popup windows. Sascha Am Montag, 7. Oktober 2002 03:22 schrieb arnaud gonzales: > So my

Re: [PHP] IIS 5 - ASP & PHP dev enviorment

2002-10-06 Thread Sascha Cunz
> > You can run both of them without problems. Since ASP is a default on > IIS, any IIS server set up to run PHP is running them both... I haven't > heard of any problems caused just by having the two running at once. > > ---John Holmes... I got this configuration times ago... Works without any p

Re: [PHP] need help for a where clause

2002-10-06 Thread Sascha Cunz
A solution on that depends strongly on how much values A.Afn would take. For 3, it's still okay. But i wouldn't do more. Against what shall the B.Bfn* be checked? What Data do you want to be returned from the query? try: SELECT ### FROM A, B WHERE ((A.Afn=1) AND (B.Bfn1 = ...)) OR ((A.Af

Re: [PHP] Re: Can it be Done?

2002-10-06 Thread Sascha Cunz
x27; function to send querystring > arguments? I'd rather used urlencode... > > "Sascha Cunz" <[EMAIL PROTECTED]> ha scritto nel messaggio > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > To produce such a JavaScript: > > define('_DOMBASE', 'h

Re: [PHP] Re: Can it be Done?

2002-10-06 Thread Sascha Cunz
To produce such a JavaScript: define('_DOMBASE', 'http://yourdomain.com'); echo ''."\n" .'if (document.location == top.location)'."\n" .' top.location="'._DOMBASE.'/index.php?goto=' .base64_encode($_SERVER["REQUEST_URI"]).'";'."\n" .''; where the index.php works like:

Re: [PHP] Can it be Done?

2002-10-06 Thread Sascha Cunz
Hi, i don't think you can do this all on Server-side. I once made things like that work with usual frames. I used Javascript in each page of the frameset to find out if the "parent" exists - and if not, redirect to the frameset which itself was a PHP script whom i told to load the current page

Re: [PHP] More Detailed Gettext() article?

2002-10-05 Thread Sascha Cunz
Try the GNU Documentation on gettext: http://www.gnu.org/manual/gettext/index.html Regards Sascha Am Sonntag, 6. Oktober 2002 01:51 schrieb Wee Keat [Amorphosium]: > Hi everyone.. > > Sorry for bothering u guys for such trivial matter... > > But where can I get a good article on how to use

Re: [PHP] More On: Good Practice: Variables, Error Reporting and Security

2002-10-05 Thread Sascha Cunz
Am Samstag, 5. Oktober 2002 20:44 schrieb Adam Royle: > I very much appreciate the suggestions made by the people on this list, > although for me, when developing, the less typing I have to do, the > less errors I am bound to come across, and therefore the less debugging > I must do. (Now, doesn't

Re: [PHP] backwards compat for newly developed scripts ($_GET / $HTTP_GET_VARS)

2002-10-01 Thread Sascha Cunz
> ummyou'd have to include that line at the top of every function that > uses get(or any of the other) vars(scoping reasons) or somehow pass it via > a reference to the function. I've always added the line at the top. At the top of each _function_? Urgs. Sounds like a hell of a lot of work.

Re: [PHP] backwards compat for newly developed scripts ($_GET / $HTTP_GET_VARS)

2002-10-01 Thread Sascha Cunz
> Hey gang, > I've been wondering about developing scripts that the end-user might run on > php < 4.1.0. I've heard allot of ways except for one that I recently > thought of. > How about using: > - > if(!isset($_GET)) { global $HTTP_GET_VARS; $_GET = &$HTTP_GET_VARS; } > - > ? That allow

Re: [PHP] Wanting to better understand

2002-10-01 Thread Sascha Cunz
Anyway... cool way to use switch Obviously i've been working too much with C, that i never thought of a way, you could use the conditional-expression in the "case", not in the switch ;) Sascha > switch (TRUE) { > case ($days > 45): > $days = "" . $days . > ""; break; case

Re: [PHP] Re: Thanks

2002-09-29 Thread Sascha Cunz
> Thank you Sascha and Matt you got it ! Everything is working fine now. > There is a lot of printing error in this book :( Sadly that's a property of most IT-Books :-( I've hardly ever seen another kind of books with more printing errors than IT books used to have... Sascha -- PHP General Mai

Re: [PHP] Undefined constant error

2002-09-29 Thread Sascha Cunz
> make sure you have register_globals on in php.ini or your next question > will be 'why isn't $compteur set to the value posted?' Better would be to > change the line to the new magic globals, and learn the right way from > scratch: I agree with you as far, as to learn the right way from scratc

Re: [PHP] Undefined constant error

2002-09-29 Thread Sascha Cunz
There seems to be a print-error in this book. It's missing a '$' This line: > if (compteur == 1) { should be: > if ($compteur == 1) { Sascha Am Montag, 30. September 2002 01:52 schrieb Voisine: > Hello, > > I'm learning PHP from a book "PHP for newbie writen in French" and I > have an

Re: [PHP] Posting a value to one form to another

2002-09-28 Thread Sascha Cunz
Oops, of course you must add one to it, too. like: Regards, Sascha > Hello, > > > On Sun, 29 Sep 2002, Sascha Cunz wrote: > > SC>I think your linux plattform has a version of PHP older than 4.2.0 and > your SC>Windows machine has a newer Version. In this "old&

Re: [PHP] Posting a value to one form to another

2002-09-28 Thread Sascha Cunz
I think your linux plattform has a version of PHP older than 4.2.0 and your Windows machine has a newer Version. In this "old" Versions, Register_Globals was turned on. Try to access $hid by using: Regards Sascha > Hello , > > border="0"> > > While clicking this link the $hid value get incre

Re: [PHP] Session Not Saving?

2002-09-28 Thread Sascha Cunz
> function check_valid() > { > global $valid_user; > if (session_is_registered("valid_user")) > { > echo "Welcome $valid_user!"; > } > else > { > echo "You are not logged in."; > exit; > } > } try it like this: function check_valid() { global $valid_user; if (is

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Sascha Cunz
> Does PHP do what? By default the MySQL query function can only take one > query at a time. There is nothing strange about this. The command-line > mysql tool can take multiple queries separated by semi-colons, but that is > something that is implemented in that command-line tool. It is not d

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Sascha Cunz
> Yeah, good catch on the addslash/magic_quote. > > Also, FYI: PHP will only allow you to do one query per mysql_query(). So > you can't try to end a quote and then send another query. Don't know if > this is the case for all database functions, or what... Does PHP this? Such behaviour would be p

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Sascha Cunz
> /* db access using postgresql - each row is displayed */ > ... > {$myrow['request']} > ... > ?> > > Now unless I can do something like: > > 'nl2br({$myrow['request']}' Try something like echo ''.nl2br($myrow['request'].''; Regards Sascha -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Sascha Cunz
> Hi John, > > Sorry about the ambiguity. What I'm trying to accomplish is close to what > you describe. However, before anything goes into the db (ie html chars, bad > commands, or anything from Mr.Hacker), I verify it. Someone suggested, way > back when I first started with textarea, to use 'htm

Re: [PHP] Running a PHP script automatically?

2002-09-22 Thread Sascha Cunz
> On the Linux box compile PHP as CGI (i.e. don't configure it as an apache > mod). Then you can just run your script from the the command-line. This is called CLI (Command Line Interface), not CGI (Common Gateway Interface). The CGI is called from an WebServer; CLI get's called from a shell-(s

Re: [PHP] Redirection

2002-09-22 Thread Sascha Cunz
And also avoid including scripts that contain a linebreak or a space after any '?>'. When I did this first time, it took me ages to find out what was wrong... :-) Sascha Am Montag, 23. September 2002 02:07 schrieb Justin French: > Validate the input BEFORE outputting anything to the browser...

Re: [PHP] accessing session variables

2002-09-21 Thread Sascha Cunz
Just use the session_start() in the second page and they will be magically there where you've put them in the first page. Sascha Am Samstag, 21. September 2002 17:01 schrieb Murat Ö.: > hi, > > page1.php creates a session and its variables in it in successfully. the > variables and values are

Re: [PHP] Editor

2002-09-21 Thread Sascha Cunz
Newest gvim for windows acts in most cases just like any other editor, too. You can mark text with the mouse, scroll over with the scrollbars etc. etc. It even got a nice menu. This is the best you can get - and it does everything. I even switched from VC++'s IDE to gvim, now ;-) Am Samstag,

Re: [PHP] checking if an array is empty

2002-09-21 Thread Sascha Cunz
There are many different states, in which an array would be empty. Can you post the output of a "var_dump($array);" in that special case you want to check? In general: 1. the variable may not have been set: if (!isset($myarray)) echo 'error'; 2. the variable is set, but ain't an array:

Re: [PHP] Date Time

2002-09-20 Thread Sascha Cunz
You have to add (or subtract) 28800 seconds to/from current time and use this as the 2nd input to date. echo date("Y-m-j", strtotime("now") + 28800); Sascha > Hi,, > > my server is located in the US and i live in Sweden, so when i try to run > the following command i get a 8hour diffrence,, an

Re: [PHP] Re: java in php4 on debian testing distribution?

2002-09-20 Thread Sascha Cunz
> I sincerely believe that the problem lies in my php installation, not in > my java installation, which is why I'm asking whether the debian php4 > package in the testing distribution, which is more specifically > PHP/4.1.2 according to X-Powered-By in phpinfo(), has java support > compiled in, w

Re: [PHP] HTML 2 TEXT

2002-09-20 Thread Sascha Cunz
> what he really needs is to completely remove ..., plus > many many other examples. > > completely removing everything outside the body would be another option, > perhaps saving the contents of ... since a

Re: [PHP] Friend of function??

2002-09-18 Thread Sascha Cunz
Just as Kevin Stone said, you can either use one of these constructions: function func1() { global $myarray; array_push($myarray,1); } # _or_ function func2() { array_push($GLOBALS['myarray'],1); } In fact, there is no performance decrease, because PHP will internally use the same mechani

Re: [PHP] SELECT dropdown from a db query?

2002-09-18 Thread Sascha Cunz
Change to Sascha Am Donnerstag, 19. September 2002 03:34 schrieb Andre Dubuc: > I'm trying to generate a dropdown SELECT list from a database query. So > far, all I've managed to create is multiple one-item dropdowns for each > database entry spread across the page. Bad -- very bad! > > I'd li