[PHP] Re: multithreading

2002-05-15 Thread Julio Nobrega Trabalhando
This might help you: http://www.faqts.com/knowledge_base/view.phtml/aid/1982/fid/58 I've also seen before an actual php script that interacts with a C program to do the same. Google for it and it will be esay to find. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/t

[PHP] Re: Alternate To Making Form Variables Global (Clerified)

2002-05-06 Thread Julio Nobrega Trabalhando
This is not the global that is meant on the update. Not the global $var that you put inside your functions. That's scope, btw. You are making a variable available inside a different scope (the function), by making it "global". The global you are searching for is, like when you submit a for

[PHP] Re: Very Large MySQL Query String

2002-05-06 Thread Julio Nobrega Trabalhando
Instead of uploading to Mysql, why don't you store the file at a directory and on Mysql only the path to it? Retrieving files from the hard drive is much faster than doing the same on Mysql, and also access to manipulation (insert, update, delete, etc...) -- Julio Nobrega. Um dia eu chego

Re: [PHP] Replacing non exact strings

2002-05-03 Thread Julio Nobrega Trabalhando
Thanks Brian, it's working! -- Julio Nobrega. "Brian Paulson" <[EMAIL PROTECTED]> wrote in message 005101c1f2af$fa59eb00$89010a0a@bpaulson">news:005101c1f2af$fa59eb00$89010a0a@bpaulson... > Julio, > > Try this -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http:/

[PHP] Replacing non exact strings

2002-05-03 Thread Julio Nobrega Trabalhando
Hi List, Imagine a form where user can search for clients using a 'name' field. When submitted, there's a result page, linking results to another page with the client information. I need to make the terms inputted at the form bold when they appear at the client information page. Problem is

[PHP] Re: avoid multiple submissions

2002-05-02 Thread Julio Nobrega Trabalhando
Make a unique form key for every form. When someone submits, store this unique key. Don't insert another form is there's a key already there :-) Make sure it's unique, like of current time in miliseconds plus random characters, I don't know. -- Julio Nobrega. Um dia eu chego lá: http://sou

Re: [PHP] Re: why is better?

2002-05-02 Thread Julio Nobrega Trabalhando
o learn. Are you saying that It is going to be slower or > poorer performance? > > Thanks alot > > -Steve the newbie. > > -Original Message- > From: Julio Nobrega Trabalhando [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 01, 2002 6:41 PM > To: [EMAIL PROTECTE

[PHP] Re: Kinda HTML and PHP question....

2002-05-01 Thread Julio Nobrega Trabalhando
$text = substrt($text, 0, 75) . '...'; Cuts anything beyond 75 caracthers and add "..." to the end of it. Also, you could when people submit anything check for spaces if the size is greater than a number of characters: if (strlen($text) > '75' && !ereg(' ', $text)) { echo 'Please use sp

[PHP] Re: why is better?

2002-05-01 Thread Julio Nobrega Trabalhando
Faster, and better interaction with the engine that runs php (and therefore other parts of the system). -- Julio Nobrega. "Franky" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Why is better to write module than class? > ok is compiled code so is supose to

[PHP] Re: PHP 4.2.0 + Apache 2.0.35 (W2KSP2)

2002-04-30 Thread Julio Nobrega Trabalhando
Load the experimental apache2filter.dll instead. -- 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 "Kirk Babb" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTE

[PHP] Re: In Addition to [PHP] PHP Security

2002-04-29 Thread Julio Nobrega Trabalhando
1) Yes, store this kind of information outside of your web-root. But I am not sure if Apache will return the source even if php's parser crashes. If you are using the module version of php, Apache should be able to "re-start" itself when such error is found. I believe you can setup Apache (and may

[PHP] Re: build array dinamicaly

2002-04-29 Thread Julio Nobrega Trabalhando
$name = Array(); $address = Array(); $clients = Array('nome' => 0, 'address' => 0); $i = 0; while (list($client_name, $cliente_add) = mysql_fetch_array($res)) { $name[$i] = $client_name; $address[$i] = $client_address $clients['nome'][$i] = $client_name; $clients['address'][$i] =

[PHP] Re: web application development question

2002-04-26 Thread Julio Nobrega Trabalhando
I let them in a database and a nice administration page so people can change. There are a lot of more information that you can store, such as last time of change, and previous values (so peopel can "rollback" them), who changed, description of the value, related to other values, and there always

[PHP] GD: º becomes $

2002-04-25 Thread Julio Nobrega Trabalhando
When I create an image, º becomes $. Actually a small $. (pratically half-sized). Maybe it's a "s" with a tail. I really have never seen this character before :-) An example: $im = @ImageCreate (450, 500) or exit ("Cannot Initialize new GD image stream"); $background_color = ImageColorAl

Re: [PHP] Destroy a session var passed as an argument

2002-04-24 Thread Julio Nobrega Trabalhando
> And let me know if that works or doesn't work. (It's kind of a hunch, > hard to tell from your code if it will work.) Didn't. I still get the same error, using unset($mensagem). Also tried: global $mensagem; session_unregister($mensagem) Also tried: showError(&$_SESSION And a mix

[PHP] Destroy a session var passed as an argument

2002-04-24 Thread Julio Nobrega Trabalhando
Hi All! I have a simple function that returns a message: function showError ($mensagem) { return '' . $mensagem . ''; } And this is how I use it: if (isset($_SESSION['forum']['error']['insert'])) { echo showError($_SESSION['forum']['error']['insert'])); } But I want that when

[PHP] Re: Display large text fields in html

2002-04-23 Thread Julio Nobrega Trabalhando
If you have over 1000 entries, each one with ~10 lines of text, I would go with frames. Not inline-frames, but a true frames. So each change can load the frame and show the information. Also, a with 1000 entries? Break it apart. For example make one with (imagine this is a select in your bro

[PHP] Re: What's wrong with the PHPSESSID?????

2002-04-23 Thread Julio Nobrega Trabalhando
Insn't inside a function, therefore confliting with the scope? Or maybe you have to use $_GET['PHPSESSID']? Also, on your tag, I didn't see the PHPSESSID part. Also, it's a good idea to use double quotes for html element properties, & instead of &, and always echo the var instead of the shor

[PHP] Re: How do i upgrade from PHP 4.1.2 to 4.2.0?

2002-04-23 Thread Julio Nobrega Trabalhando
Are you using Windows? That's the one I can give you a tip about :-) Stop the server, overwrite all php files with the new ones, pick up the new "php4ts.dll" and copy it to your Windows, Windows\System and Windows\System32. Restart the server :-) -- Julio Nobrega. Um dia eu chego lá: http:

[PHP] Re: PHP editor for windows

2002-04-22 Thread Julio Nobrega Trabalhando
www.phpide.de It's called PHP Coder. Don't get the versions by Maguma (last time I used, it was buggy). Instead, go to older downloads and get the PHP Coder file named phpide-r2p3setup -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um pres

Re: [PHP] Re: Backup of MySQL database

2002-04-22 Thread Julio Nobrega Trabalhando
anual. Or simply do not have to time to wade through the manual to find 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=634&single=1 -Original Message- From: Julio Nobrega Trabalhando [mailto:[EMAIL

[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á: http://sourceforge.net/pr

[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 source

[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: 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: 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(), w

[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
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, $file_where_ha

[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] 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 cont

[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? http://www.submarino.com.br/wishlistclien

[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á: h

[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? Qu

[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: 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 Pear'

[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 PRO

[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 bundl

[PHP] Re: unique ID

2002-04-11 Thread Julio Nobrega Trabalhando
Make an autoincrement/primary column? Or keep a number stored and increase it one by one and using when derirable? I prefer the first one :-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/w

Re: [PHP] string...

2002-04-11 Thread Julio Nobrega Trabalhando
Checkout the substr() function. You can do something like: if (substr($var, -9) = '_.jpg')) { // do something } -9 would be the staring position. I am not sure if this is the right number, so you will have to look at the manual :-) -- Julio Nobrega. Um dia eu chego lá: http://sourc

[PHP] Re: Statistic Variables

2002-04-11 Thread Julio Nobrega Trabalhando
Referer page ($HTTP_REFERER), current page (REQUEST_URI), ip ($X_FORWARDED_FOR or $REMOTE_ADDR), host ($HTTP_HOST), time (date() or database's NOW()), username (if you have somekind of authentication), the operating system and browser (from $HTTP_USER_AGENT or similars). These are the ones I lo

[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" <[EM

[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: $sq

[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: help condensing regular expressions

2002-04-05 Thread Julio Nobrega Trabalhando
How about: $site_root = '/www/user/htdocs/'; 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á: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinh

[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 pag

[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"

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á: http://sourceforge

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 PROTE

[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: fwrite($f

[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? http://www.su

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á: http://sourceforge.net/projects/to

[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? http://www.submarino.com.br/wishlistclient.asp?wlid=6641

[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=1&b=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 che

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

2002-03-27 Thread Julio Nobrega Trabalhando
p://sourceforge.net/projects/toca Ajudei? Salvei? Que 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! > >

[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 Write

[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 selects

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] . ''; } Concanate array key 'address' with $i -- 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

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 Maili

[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á: http:/

[PHP] Re: Debugging tool

2002-03-25 Thread Julio Nobrega Trabalhando
http://www.google.com/search?q=php+debugger&sourceid=opera&num=0&ie=utf-8&oe =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 "Mor

[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? http://www.submarino.com.br/wishlistclient.asp?wlid=6641767

[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á: http://sourceforge.net/projects/

[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: http://www.php.n

[PHP] Re: ecommerce solutions..

2002-03-21 Thread Julio Nobrega Trabalhando
There's http://www.oscommerce.com/. Although I have never used, I heard a lot of good things about it from my friends. -- 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=664176

[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 m

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 ju

[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? http://www.submarino.com.br/wishlistclient.asp?wl

[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? http://www.subma

[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 and/or echo, print, etc...? Well, you could try to make a smaller version of the included file that doesn't outpu

[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 yo

[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: Populating Dropdown with MYSQL data

2002-03-15 Thread Julio Nobrega Trabalhando
$name"; } ?> -- 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 "Jeff Dale" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I

[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á: http://sourceforge.ne

[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 PROTE

[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: register_globals and E_ALL error reporting

2002-03-13 Thread Julio Nobrega Trabalhando
DEFINE('DBF_HOST', 'localhost'); When PHP sees DBF_HOST without quotes it thinks it should be a constant. Even inside define()... just quote it, define still works. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.

[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

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: 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 PROTECTED]">ne

[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? http://www.submarino.com.br/wishlistclient.a

[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: From here, you might go with readfile(); or file(), that will display the pointer's content

[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: There isn't a space between field and 1, at least I don't think SQL compliant

[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 me

[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

[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" <[EMAI

[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/1845238&mode=thread&t id=169 http://security.e-matters.de/advisories/012002.html http://www.newsbytes.com/news/02/174818.html Doesn't affect Windows, right? --

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? http://www.submarino.com.br/wishlistclient.asp?wlid=66

[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 have

[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 PROTECTED]">new

[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? http://www.submarino.com.br/wishlistclient.asp?wlid=6641

[PHP] Re: Undefined class name

2002-02-15 Thread Julio Nobrega Trabalhando
ini_set('include_path', 'J:/Program Files/php/pear/'); require_once 'PEAR.php'; require_once 'DB.php'; ini_set(); should be the 'root' where all included files will be found. On Windows you use / for paths or sometimes \\ (escaping a \). Anyway, the above method works on my machine. --

[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 . Btw, you should start with And if $submitdata is expected to come from a form, check it: if ($_SERVER['HTTP_REFERER']

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 (http://www.p

[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 Ajudei

[PHP] Re: block and

2002-02-07 Thread Julio Nobrega Trabalhando
or ? Anyway, you could try to block with Javascript the key, which is common among all your options (or and ). 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 exact code but a google

[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? http://www.submarino.com.br/wishlist

[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 , 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 "Ra

[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 develo

[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? http://www.submarino.com.br/

[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 whe

  1   2   >