[PHP] $PHPSESSID on PHP 4.1.0

2001-12-17 Thread Julio Nobrega Trabalhando
Hi All, I have a few scripts using $PHPSESSID to softly disable cookies requirement on some pages. I just installed PHP 4.1.0 and I am porting some lines to adapt to the new version. If I do this: ?php echo $PHPSESSID; ? It doesn't show nothing at all. Did something changed, does

[PHP] Re: $PHPSESSID on PHP 4.1.0

2001-12-18 Thread Julio Nobrega Trabalhando
Hi again, Here are a few updates (error_reporting(E_ALL)): $_SESSION['PHPSESSID']; // Undefined index PHPSESSID error ?=SID? // Doesn't work. Not even a undefined variable. // echo $SID doesn't either But: echo session_id(); // works! Thanks Andrey for the remainder, but session were

Re: Re: [PHP] Passing through Array's to another script

2001-12-18 Thread Julio Nobrega Trabalhando
Well, there's a small difference between form's GET/POST and passing variables using the ? on urls. I don't know the techinal details of it, but it's possible. I guess, on this particular case, the form method is POST. When the next page is loaded (the action target), you put some GET

Re: [PHP] Passing through Array's to another script

2001-12-18 Thread Julio Nobrega Trabalhando
However, you can't do this: form action=script.php?a=foob=bar method=post input name=c /form Because a b won't get submitted. Well, like I said, I don't understand very well, but things after the ? are available on the action page, even if the method is POST. Here's a tested example

Re: [PHP] Re: $PHPSESSID on PHP 4.1.0

2001-12-18 Thread Julio Nobrega Trabalhando
Yes, I know. But the problem is PHP 4.1.0, or maybe something on the new php.ini that comes with. My scripts were echo'ing $PHPSESSID fine before it. -- Julio Nobrega. Um dia eu chego la: http://sourceforge.net/projects/toca Andrey Hristov [EMAIL PROTECTED] wrote in message

Re: [PHP] Re: $PHPSESSID on PHP 4.1.0

2001-12-18 Thread Julio Nobrega Trabalhando
Yes! That's it. I was accessing vars using new methods, but I forgot $PHPSESSID was supposed to have globals on. So simple, yet I have flooded the list with messages. Thanks Andrey, I think it's better next time look at all possible options ;-) -- Julio Nobrega. Um dia eu chego la:

[PHP] One good thing about $_SESSION

2001-12-26 Thread Julio Nobrega Trabalhando
Is that while porting a script to PHP 4.1.0, where I used to check: if (session_is_registered('del_power') $del_power == 1) { // del stuff } Because $del_power could be registered as 1 or 0, now I can do: if ($_SESSION['del_power'] == 1) { // del stuff } Nice. Less typing and

Re: [PHP] One good thing about $_SESSION

2001-12-26 Thread Julio Nobrega Trabalhando
Yes, but I just thought of doing this way when porting :-)) PS: (Not 100% true, there's the question of $_SESSION being global now. Makes life easier too :-)) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List (http://www.php.net/) To

[PHP] Re: How to desactivate some functions ?

2001-12-28 Thread Julio Nobrega Trabalhando
php.ini has a disable_functions setting, maybe acessable by ini_set() too... -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Yves Reveillon [EMAIL PROTECTED]

[PHP] Re: PHP dependent on connection speed?

2002-01-03 Thread Julio Nobrega Trabalhando
No, it's server side. Only if you flush some kind of content, with parts of the script waiting to be executed after these contents are 'used' by the user. This would not affect in how much time certain script lines are executed (since it's the server who process them), but the overall

[PHP] From 4.1 to 4.04pl1

2002-01-04 Thread Julio Nobrega Trabalhando
Hi everybody, On my dev machine I have php 4.1. I have now to upload a huge script half ported to 4.1 from 4.06 on a host where 4.04pl1 runs. By 'half-ported' I mean almost every file I changed global $form_var or function($form_var) to $_POST['form_var']. But it will not work since

[PHP] if() Load a different php.ini

2002-01-08 Thread Julio Nobrega Trabalhando
Hi All, I used php 4.0.6 and had to port a system to 4.1.0. So I changed some vars ($_POST, $_SESSION, etc..), and begin to use the new php.ini (with different scope for stuff). We hired another person to work with us on another project. So I need him to access on a different machine my

[PHP] Re: E-Commerce

2002-01-08 Thread Julio Nobrega Trabalhando
I haven't used, but heard good stuff from folks of the local mailing list, from TEP. http://theexchangeproject.org/ -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

[PHP] Re: PHP vs. ASP

2002-01-09 Thread Julio Nobrega Trabalhando
Database is a good point. PHP has native support for several, while I believe ASP do not (through ODBC). Modules, and their price. At least I heard in ASP you have to pay for some of them (well, more than those on PHP). Typecast? I am not sure if in ASP you have to, I remember I heard

[PHP] Re: Newbie

2002-01-09 Thread Julio Nobrega Trabalhando
Both ways. I would use session if the form(s) must be completed at once. If someone can save forms 1 and 2 and another day return to complete the remaining steps, then a database might be better. Also, if you use a database to hold temp info that must fly between the forms, you would have to

[PHP] Re: PHP vs. ASP

2002-01-09 Thread Julio Nobrega Trabalhando
Sorry, corrected on PHP only after 15 being reported.. should read: corrected on PHP only after 15 minutes being reported.. That was a good thing I saw. I still remember, some exec() problems with slashes and some letters on a specific plataform. Stunned me how fast the bug was solved.

[PHP] Re: Redirection and Passing Data (arrays)

2002-01-15 Thread Julio Nobrega Trabalhando
session_register('array_of_selected_checkboxes'); Just use sessions! ;-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 M. Ali [EMAIL PROTECTED] wrote in

[PHP] Re: Sound File Available???

2002-01-15 Thread Julio Nobrega Trabalhando
file_exists(); if (file_exists('1234.rm')) { // show one image } else { // show another image } Just correct the path of file_exists argument to the one you need/use. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

[PHP] Re: PHP image rollovers question...

2002-01-15 Thread Julio Nobrega Trabalhando
Check out when you can use and ' Any number of ' inside gets printed and $vars are parsed (i.e, 'interpreted by php') Any number of inside of ' gets printed and $vars are NOT parsed. echo script style=javascript; is wrong because you start at the first and the after the second you

[PHP] Re: HTTP_IL_PAD global variable?

2002-01-16 Thread Julio Nobrega Trabalhando
I don't have it! Could not find using echo $HTTP_IL_PAD neither saw it at phpinfo(). Do you have any non-default module installed? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Bill [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

[PHP] Re: Scripts keep refreshing

2002-01-18 Thread Julio Nobrega Trabalhando
Maybe you were doing something like this: if (function() == true) { header(Location: this_page.php); } And your function() is now broken because you upgraded to php4? It's probaly something like this, some function that worked on php3 and now it's not. -- Julio Nobrega. Um dia eu

[PHP] Re: Feature Suggestion

2002-01-18 Thread Julio Nobrega Trabalhando
?php $array = range('a','z'); ? As usual your mileage may vary but it worked here :-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Mike Eheler [EMAIL

Re: [PHP] Content Management

2002-01-31 Thread Julio Nobrega Trabalhando
Zope mantains a lot of large sites. Also I know www.ig.com.br (second most accessed site here in Brazil) uses Vignette. In fact, ALL large sites has to use some kind of CMS, otherwise keeping the large amount of content and related operations between sub-sections is close to impossible. --

[PHP] Re: add on's to php

2002-01-31 Thread Julio Nobrega Trabalhando
www.php.net/dl :-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Kunal Jhunjhunwala [EMAIL PROTECTED] wrote in message

[PHP] Re: HowTo Send HTTP POST from Within Scrip

2002-02-05 Thread Julio Nobrega Trabalhando
It's usually done with fsockopen();, and curl module functions for SSL servers. There are a few classes for each method, on the most tradicional snippets and clasess websites. I enjoyed using one called Snoopy. Also the manual pages comments are very helpful (both on fsockopen(); related

Re: [PHP] Is this possible?

2002-02-06 Thread Julio Nobrega Trabalhando
I am sorry, this has nothing to do with the logic of your code, but instead with style (and a little bit of perfomance, both from you and your system). Isn't easier to escape PHP when you are going to enter html code lines? Like this: ?php if ($myrow = mysql_fetch_array($varetabell) AND

[PHP] Re: !isset ??

2002-02-06 Thread Julio Nobrega Trabalhando
If your purpose is to see if an user wrote or selected anything, you can do: if (ereg(^[[:blank:]]*$,$_POST['var'])) { // It has only spaces } I am sorry if does not fit your need like I interpreted. But, just for not getting flamed, !isset() works fine for me on both cases (so far

[PHP] Re: Link Inquiry

2002-02-07 Thread Julio Nobrega Trabalhando
There's a class named Snoopy on Sourceforge that can do this for you. At least it's a place where you can look at the sources and see how it's done. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

[PHP] Re: Using functions before they're defined

2002-02-07 Thread Julio Nobrega Trabalhando
My guess it's that since the page is entirely read before processed (hence you get parse errors and nothing before it's executed), the function calls are store somewhere waiting for the definitions. Once the page is entirely parsed, the functions try to execute... If you asked with PHP

[PHP] Re: Simple for you, not for me

2002-02-07 Thread Julio Nobrega Trabalhando
Maybe a nl2br() will solve? It converts new lines from .txt documents for example to br, for html documents. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884

[PHP] Re: help with PHP global array

2002-02-07 Thread Julio Nobrega Trabalhando
$array = Array('a'=1); function scope_test() { global $array; echo $array['a']; } Works for me, PHP 4.1.1 with the new .ini file. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

[PHP] Re: block ctrlaltdel and alttab

2002-02-07 Thread Julio Nobrega Trabalhando
shiftf4 or altf4? Anyway, you could try to block with Javascript the alt key, which is common among all your options (or alt and shift). There's a key map on Javascript that references each keyborad key with a variable. Just do something like onKeyPress('var') = ''. I don't remember the

[PHP] error_reporting(E_ALL) and undefined vars

2002-02-07 Thread Julio Nobrega Trabalhando
Hi All, I develop with error_reporting(E_ALL). It's a major pain to type everytime if(isset($some_var)) To avoid undefined variable errors. Any tips? If you turn E_ALL on error_reporting, what do you do? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca

Re: [PHP] error_reporting(E_ALL) and undefined vars

2002-02-07 Thread Julio Nobrega Trabalhando
Thanks Jon. But, that's for security, right? Maybe even other reasons. I know close to zero of programming theory, so, why is it bad to have undefined vars on the code? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List

[PHP] Re: good practice

2002-02-14 Thread Julio Nobrega Trabalhando
Well, for instance. I don't like forms that submit to the same page where it is located. Separating them helps to maintain the code (usually). I don't like html inside ?php so 99% of the times I escape with ?. Btw, you should start with ?php and not ?. Your input is missing the /, newer

[PHP] Re: scheduled tasks

2002-02-15 Thread Julio Nobrega Trabalhando
If someone or something loads your page on this particular day, you can have a: if (date(...) == 'day') { mail(); } -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

[PHP] Re: date problem

2002-02-18 Thread Julio Nobrega Trabalhando
Mysql? INSERT INTO table VALUES (NOW()); -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Eoghan [EMAIL PROTECTED] wrote in message [EMAIL

[PHP] Re: intranet security

2002-02-27 Thread Julio Nobrega Trabalhando
I've done it :-) But be careful. There are dozens of way to implement this. My way is simple, but makes use of too many sql queries I believe. Could have stored everything in one line and grab it at user's login, but anyway My current way seems more logical to follow and update. I

Re: [PHP] apostrphe's entered into MySQL database

2002-02-27 Thread Julio Nobrega Trabalhando
Why isn't addslashes() working? You addslashes then you stripslashes() :-) Anyway, how about mysql_escape_string()? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

[PHP] Re: Did everybody see the security warning at php.net?

2002-02-27 Thread Julio Nobrega Trabalhando
Yes :-) http://www1.dshield.org/pipermail/vuln/2002-February/07.html http://developers.slashdot.org/article.pl?sid=02/02/27/1845238mode=threadt id=169 http://security.e-matters.de/advisories/012002.html http://www.newsbytes.com/news/02/174818.html Doesn't affect Windows, right? --

[PHP] Re: how to: variable = php parsed file include

2002-02-28 Thread Julio Nobrega Trabalhando
Find on phorm.php where you want to put your nav bar, and use: include('file_name.php'); -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Brian Petro [EMAIL

[PHP] Re: problems with replacing line breaks

2002-03-01 Thread Julio Nobrega Trabalhando
Have you tried nl2br()? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Tom Kincaid [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; I'm trying to

[PHP] Re: posting data with curl

2002-03-01 Thread Julio Nobrega Trabalhando
Submit the data to the action= url of the form, not to the form's page. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Wm [EMAIL PROTECTED] wrote in message

[PHP] Re: Deleting a Record

2002-03-06 Thread Julio Nobrega Trabalhando
First of all, make a copy of your database to test things. Never test code on production enviroment. Then, the delete syntax most of the time is: DELETE FROM table_name WHERE column = 'value'; Let's see: ?php $table = 'table_name'; $value = '15'; $sql = DELETE FROM $table WHERE

[PHP] Re: Reading A file

2002-03-06 Thread Julio Nobrega Trabalhando
If it's a file ending in .txt, you don't need PHP at all to make visual on the web, most browsers will just display it on the screen. Just link to it. But, if you want to echo it inside html, do: ?php $filename = 'path/to/file.txt'; $fd = fopen($filename,'r'); // might be 'rb', check manual

[PHP] Re: php, text file, and mysql

2002-03-07 Thread Julio Nobrega Trabalhando
If you are not going to save, I wouldn't call it a file :-) Just store the contents in a string and insert in a TEXT (etc) field. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

[PHP] Re: registering $_REQUEST variables as session variables.

2002-03-11 Thread Julio Nobrega Trabalhando
$_SESSION['from_form'] = $_REQUEST; -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Zara E Gonzalez [EMAIL PROTECTED] wrote in message [EMAIL

Re: [PHP] Re: registering $_REQUEST variables as session variables.

2002-03-11 Thread Julio Nobrega Trabalhando
It would register a session variable name 'from_form' equal to $_REQUEST; The name 'from_form' was just an example, you need to change it according to your needs, if you wish. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Zara E Gonzalez [EMAIL PROTECTED]

[PHP] Re: download 32000 images another server server

2002-03-13 Thread Julio Nobrega Trabalhando
You could try to compress the images using php or telnet, or do it in batchs from 5000 files. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Random Selecting from mySQL

2002-03-13 Thread Julio Nobrega Trabalhando
You could store the results in a session var to carry along the pages. Then on the second just retrieve them. Or maybe a second table with this info. Give each search an ID and store the results there. It would be easy to implement: INSERT INTO table ('',field) SELECT field FROM table ORDER

[PHP] Re: Can Event Handlers Trigger PHP Code?

2002-03-14 Thread Julio Nobrega Trabalhando
No, because 'activation' of php is done by the server. PHP is a server side language. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Dr. Shim [EMAIL

[PHP] Re: Online Feedback and Application

2002-03-14 Thread Julio Nobrega Trabalhando
Whetever you prefer. You may mail the form to you, or store in a database/file for retrival. Me? I would store on a database and make a page where I can see the feedbacks. I got so many emails daily that more would not be welcome. -- Julio Nobrega. Um dia eu chego lá:

[PHP] Re: Populating Dropdown with MYSQL data

2002-03-15 Thread Julio Nobrega Trabalhando
select name=somename ?php $sql = SELECT id, name FROM table; $res = mysql_query($sql); while (list($id, $name) = mysql_fetch_array($res)) { echo option value=\$id\$name/option; } ? /select -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal

[PHP] Re: Help - Variables

2002-03-15 Thread Julio Nobrega Trabalhando
if (isset($var_name)) { echo 'Isset!'; } ? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Budinschi Cosmin [EMAIL PROTECTED] wrote in message [EMAIL

[PHP] Re: Undeclared Variables

2002-03-18 Thread Julio Nobrega Trabalhando
error_reporting(); There's also an entry on php.ini to handle. It is safe although I personally do not recommend. Undeclared variables are a unexpected script behavior, it's good to know where your data is coming from and/or not trust it. For example a GET paramenter might override the value

[PHP] Re: combining headers with includes

2002-03-19 Thread Julio Nobrega Trabalhando
Isn't working because when you include the file it complains that it can't send headers? Specially because there's an output on line X of the included file? Like anything outside ?php ? and/or echo, print, etc...? Well, you could try to make a smaller version of the included file that

[PHP] Re: strlen() gives a wrong count

2002-03-19 Thread Julio Nobrega Trabalhando
Once I say \n as strlen() = 2, if I remember correctly. Definitively not 1. Any whitespaces, tabs, newline, or similar inside? strlen() count them different. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

[PHP] Re: [NEWMAN] make an if or else if statement from mysql.

2002-03-19 Thread Julio Nobrega Trabalhando
Select before to see if exists: if (db_num_rows() 0) { // Update view where ip = visitor_ip } else { // Normal insert } -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

Re: [PHP] Re: [NEWMAN] make an if or else if statement from mysql.

2002-03-19 Thread Julio Nobrega Trabalhando
if (db_num_rows() 0) {= WHERE DOSE THIS VERABLE COME FROM? This is just a count of the returned rows you have to make. First, do something like this: SELECT ip FROM table WHERE ip = visitor_ip; If it returns 0 rows, it means you don't have the ip and need to store, otherwise just

[PHP] Re: testing for blank var

2002-03-21 Thread Julio Nobrega Trabalhando
if (ereg(^[[:blank:]]*$,$img_url)) { // $img_url is blank } -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Robert McPeak [EMAIL PROTECTED] wrote in

[PHP] Re: checking if a link is still alive

2002-03-21 Thread Julio Nobrega Trabalhando
Open a connection? Maybe fopen, dns search, ip search, anything. I just don't know which way is faster (I think it's fopen). -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: Function Not Accepting Variable Values From a Form

2002-03-21 Thread Julio Nobrega Trabalhando
Scope. Try to pass the values as the function reference (inside the ()), 'global' them, or use $_POST[''], from 4.1 and beyond. If you don't know what's a 'scope', there's an entry on the manual that can explain better. -- Julio Nobrega. Um dia eu chego lá:

[PHP] Re: A Newbie needs help with his first Class

2002-03-22 Thread Julio Nobrega Trabalhando
$DOCUMENT_ROOT inside a function, scope problems. Pass it as an argument or global, or use $_SERVER['DOCUMENT_ROOT']; -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

[PHP] Re: Debugging tool

2002-03-25 Thread Julio Nobrega Trabalhando
http://www.google.com/search?q=php+debuggersourceid=operanum=0ie=utf-8oe =utf-8 Google good! ;-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Morten

[PHP] Re: cookie problem. Not possible to set and read a cookie on the same page?

2002-03-26 Thread Julio Nobrega Trabalhando
Not possible, read the manual page about setcookie: www.php.net/setcookie There's a 'common pitfall' entry saying so. Don't know why. Maybe the cookie is only written to user's disk after the page is fully loaded, maybe for security reasons. -- Julio Nobrega. Um dia eu chego lá:

Re: [PHP] OT - number of chars in querystring

2002-03-26 Thread Julio Nobrega Trabalhando
You could store the query somewhere, like in a database or file, give it an id, and store this id on a cookie. When the visitor returns, just grab the corresponding query using the cookie's id. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General

Re: [PHP] Array in a Loop Question

2002-03-26 Thread Julio Nobrega Trabalhando
for ($i=0;$i$_POST[count];$i++) { echo $_POST['address' . $i] . 'br'; } Concanate array key 'address' with $i -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

[PHP] Re: Merging Results of Queries

2002-03-26 Thread Julio Nobrega Trabalhando
You can select from multiple databases and tables, ie: SELECT database.table.field, otherdb.othertable.other FROM database.table, otherdb.othertable; Even from two, three, four databases. But your queries might either get too complicated or slow. So, store the results from simpler

[PHP] Loop non-fixed sized array

2002-03-27 Thread Julio Nobrega Trabalhando
Hi All! Here's something I am trying to do, and I don't know if it's possible. I have a function that must register session variables, values that come from an array. But each of these values will be the value of an session array, of non-fixed size. Let me explain (w and d stands for

[PHP] Re: Followup: Loop non-fixed sized array

2002-03-27 Thread Julio Nobrega Trabalhando
tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Julio Nobrega Trabalhando [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi All! Here's something I am trying to do, and I don't know if it's possible. I have a

[PHP] Re: Question on eval()

2002-03-27 Thread Julio Nobrega Trabalhando
Maybe parse_str() will do the trick? I am using it in a close situation, I store: a=1b=1 And $a has value 1, $b has value 2. But I guess to work in your case you would need to stripslashes(); and str_replace(';', '', $string) before the parse_str(); -- Julio Nobrega. Um dia eu

[PHP] Re: escaping PHP's closing tags

2002-03-27 Thread Julio Nobrega Trabalhando
Haven't seen it either, but you could use: echo '' . '?'; So is separated from ?. Or ? from for the matter. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

Re: [PHP] syntax

2002-03-27 Thread Julio Nobrega Trabalhando
Make it this way: Looping first. I will loop with while: $i = 0; $array = Array(); while (list($value) = mysql_fetch_array($result)) { $array[$i] = $value; $i++; } Arrays are easier :-) Each $i will be a key. -- Julio Nobrega. Um dia eu chego lá:

[PHP] Re: what should be my wishlist?

2002-04-02 Thread Julio Nobrega Trabalhando
Curl, gd, zlib, sockets, pdf... pear is fine but you don't need your isp to install, can have on your own directory. Humm... if possible, no safemode() enabled :-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

[PHP] Emulation: $var = print_r($array)

2002-04-04 Thread Julio Nobrega Trabalhando
Is there a way to do something like this? I wrote a wanna-be debugger. It just write to a file simple and common used function and variables, array or objects. Then when I activate it, a new window is opened with these information. Simple stuff. The problem is that if I do this:

Re: [PHP] Current URL, Last URL, error handling

2002-04-04 Thread Julio Nobrega Trabalhando
$REQUEST_URI? If it's not the full you can complement with $HTTP_HOST or similar. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Ben Edwards [EMAIL

Re: [PHP] Current URL, Last URL, error handling

2002-04-04 Thread Julio Nobrega Trabalhando
Okay, just phpinfo(); and use the variables. You can see whetever you will need there for url script construction. If you need, setup two pages with phpinfo() and a link between them so you can check for Referers (the Last Url you need) -- Julio Nobrega. Um dia eu chego lá:

[PHP] Re: Exit();

2002-04-04 Thread Julio Nobrega Trabalhando
return; stops a function execution. Function One() { If (!$var) { return; } } -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Mauricio Cuenca

[PHP] Re: Making sure a post request came from your site

2002-04-05 Thread Julio Nobrega Trabalhando
Using sessions, $HTTP_HOST, form keys, $HTTP_REFERER, ip address, Javascript. On a session you can record the user_agent on the first page, the ip, the host, and check on the form's action page. Form keys are some number you come up and pass either via url or post, and check on the action

[PHP] Re: help condensing regular expressions

2002-04-05 Thread Julio Nobrega Trabalhando
How about: $site_root = '/www/user/htdocs/'; img src=?php echo $site_root; ?images/logo.png / Instead of going relative, go from the root. Or you could put $site_root as your url: $site_root = 'http://www.your_site.com/'; -- Julio Nobrega. Um dia eu chego lá:

[PHP] Re: getting the 'client' date and time for use in PHP scripts ??

2002-04-08 Thread Julio Nobrega Trabalhando
Still you can use Javascript. get it and reload the page appending the info on the url. Or write to a file and open with php. Or you could get what country the user is and calculate the time zones. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei?

[PHP] Re: skipping a WHILE loop in mysql_fetch_*()

2002-04-09 Thread Julio Nobrega Trabalhando
For example: $sql = SELECT id FROM table WHERE name = '$name'; $res = mysql_query($sql) or exit (mysql_error()); list ($id) = mysql_fetch_array($res); That's it, use list() to make a variable, from mysql_fetch_array(). Very useful indeed for one line returns :-) More than one column: $sql

[PHP] Re: Sessions and Opera

2002-04-10 Thread Julio Nobrega Trabalhando
Cookies disabled? Or cache? Have you tried a 'fresh' Opera install or a newer version? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Steve Fitzgerald

[PHP] Re: phpMyAdmin protection

2002-04-15 Thread Julio Nobrega Trabalhando
PhpMyadmin now have somekind of authentication method. From the docs: What's the preferred way of making phpMyAdmin secure against evil access? This depends on your system. If you're running a server which cannot be accessed by other people, it's sufficient to use the directory protection

[PHP] Re: placing data outside the server root

2002-04-15 Thread Julio Nobrega Trabalhando
Yes, if the user you are, and are trying to access the dir/files, also have access to them. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Andy [EMAIL

[PHP] Re: Writing Cross DB application

2002-04-15 Thread Julio Nobrega Trabalhando
There's Metabase, one said to be the most complete of them all, available at http://www.phpclasses.org/ and PearDB, available at http://pear.php.net. I am using Pear, most because it takes advantage of another shared classes from Pear itself. For example, the Log class from Pear can use

[PHP] Re: PHP Shopping Engine Recommendation

2002-04-15 Thread Julio Nobrega Trabalhando
http://www.oscommerce.com/ -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Robert Collins [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL

[PHP] Re: meta tags from mysql

2002-04-15 Thread Julio Nobrega Trabalhando
Mysql table with a meta column and a url column: $url = $PHP_SELF; $sql = SELECT meta FROM table WHERE url = '$url'; Just select from the database a meta column depending on the url people are. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que

[PHP] Re: Screen Scraping using PHP

2002-04-17 Thread Julio Nobrega Trabalhando
I read this post a few days ago and didn't know what is Screen Scrap. I thought someone would know and would reply to you. Well, a long time has passed and none replied. So I make my question, what are you trying to accomplish in simpler terms? :-) -- Julio Nobrega. Um dia eu chego lá:

[PHP] Re: Sessions / Serialized Data

2002-04-17 Thread Julio Nobrega Trabalhando
That would be easier. fopen the session file and store the information on a database. Later you just fwrite the contents to a new file. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho?

[PHP] Error Handling Class - Any Recommendations?

2002-04-18 Thread Julio Nobrega Trabalhando
Anyone recommend a good one? I am in need of the following features: 1) Catch any type of errors, 2) Actions like: Show on the screen, log on a file or database, or email, 3) Different actions for each error level/warning type, etc.. I have searched Hotscripts, but only found classes to

[PHP] Re: Error Handling Class - Any Recommendations?

2002-04-18 Thread Julio Nobrega Trabalhando
Hi Manuel! I am looking for anything that's already done, constructed, tested. PHP does have error handling, and I could code my own class to glue all functions/necessities together, but that would take too much time. Just something at least to start from is a good thing... Saves a lot of

[PHP] Re: Error Handling Class - Any Recommendations?

2002-04-18 Thread Julio Nobrega Trabalhando
I am looking for something like this: if (error($anything)) { $method = Array('show_on_page', 'email', 'file'); $my_error_message = 'We are in trouble!'; $severity = 'Light'; $error_class-LogError($method, $my_own_error_message, $natural_error_message, $severity,

[PHP] Re: function returning true or errors

2002-04-18 Thread Julio Nobrega Trabalhando
function custom_function() { if ($error == 0) { return true; } else { return Error!; } } if (custom_function() != Error!) { echo Success; } else { echo Error; } Also, you could still return false on your custom_function(), if before the return you

[PHP] Re: Error Handling Class - Any Recommendations?

2002-04-18 Thread Julio Nobrega Trabalhando
Thanks Manuel, that's indeed a large portion of my needs. But still, from the time of my first post, among the new replies, I have found dozens of features that I think it would be interesting, and currently there's nothing suited to my needs. So I will base my work largely on use error_log(),

[PHP] Re: multiple select list

2002-04-18 Thread Julio Nobrega Trabalhando
http://www.zend.com/zend/tut/drop-down.php -- Julio Nobrega. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: equivalent of qw?

2002-04-18 Thread Julio Nobrega Trabalhando
$str = 'a b c foo bar'; $array = explode(' ', $str); -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Jack Dempsey [EMAIL PROTECTED] wrote in message [EMAIL

[PHP] Re: official statement about PHP file extensions?

2002-04-19 Thread Julio Nobrega Trabalhando
I don't think there's nothing official. If I am not mistaken, rare case, PEAR recommends using only .php It's kind of an informal consensus to use .php for anything beyond PHP3 and .php3 for PHP3-only files. This way, you script will work in most of webservers that exist. As an open

[PHP] Re: Backup of MySQL database

2002-04-22 Thread Julio Nobrega Trabalhando
Can anybody explain me how to do the backup? Mysql's manual? I want to make a script to do a backup of a MySQL DB and email me it. It is posible? Then you take the backup (aka Mysql's dump), and attach it to a mail(); -- Julio Nobrega. Um dia eu chego lá:

Re: [PHP] Re: Backup of MySQL database

2002-04-22 Thread Julio Nobrega Trabalhando
ind what they are looking for. Here is a link to a script that does essentially what you are looking for. http://www.zend.net/codex.php?id=634single=1 -Original Message- From: Julio Nobrega Trabalhando [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 6:51 AM To: [EMAIL PROTECTED] Subje

  1   2   >