[PHP] Re: Speeding up PHP or MySQL
Mysql 4 can cache queries. You can try using temporary tables, so you can break up joins. Also, perhaps making a "rawdata" table placeholder. Put a timestamp field on your columns. Make the query and store somewhere the query itself, the results and the time they were last modified. Then when the next query comes, compare if one already exists on the database. If so, only grab the "rawdata", ie, the previous results. And read Mysql's manual section about optimization if you haven't done so already, since it has important tips. -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br "Richard Baskett" <[EMAIL PROTECTED]> escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Is there anyways to speed up MySQL queries? Or showing the results through > PHP? I have several queries that have about 8 left joins or so.. Yes very > huge and when you have lots of people using these functions at once it > really slows down.. Are there any practices that you can think of that would > speed up any sql queries? I was thinking of using stored procedures, but > after a bit of research I found ou= t that MySQL doesn=B9t have that yet so > that's a no go :( Or is there a way of storing common query results? I am > looking for _anything_ that will speed up showing results to large queries.. > > I do use the ob_gzhandler and that helps a bit... Help! :) > > Cheers and Thanks! > > Rick > > "Let us live as people who are prepared to die, and die as people who are > prepared to live." - James S. Stewart > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: date
I am not sure it works, since isn't tested, but here we go. It's pure Mysql, and it would be probaly easier, faster, and more readable to do with PHP mixed. But where's the fun of it? ;-) date_field is the name of your date column. $sql = "SELECT IF(DAYOFMONTH(date_field) = DAYOFMONTH(CURRENT_DATE), 'Today', IF (date_field = DATE_SUB(date_field, INTERVAL 1 DAYS), 'Yesterday', date_field)) FROM table" If the date isn't today or yesterday, you will get the date_field contents. -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br "Alexander Ross" <[EMAIL PROTECTED]> escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have a column in one of my mysql tables which holds the date & time that > the record was inserted. When I run a query later on I want to display the > date, but if the date is today or yesterday I want to display "today" or > "yesterday" instead .. how do i compare to stored date with todays date? > todays date -1? Thanks > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Logging: Best archive method
Hi all, I am serializing every get, post, cookie and server variables to log them. I was using mysql to store this data, but I've generated with 900 pageviews a 5 (five) MB table. Now I am using the bz2 extension to accomplish this, but I am not sure if it's the best method. Are there any better alternatives? I must log this data for every requested page since it's for a bank application (ever had the Central Bank of your country asking for log files? ;-) Thanks, Julio Nobrega http://gnet.inerciasensorial.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mysql question
Christian Calloway em Friday 26 July 2002 17:30 foi agraciado com uma resposta por: > Sorry this may be a little offtopic, but I am currently moving a site I > was developing from coldfusion+MSAccess to PHP+MySQL. I remembered reading > somewhere that there is a utility that will convert/transfer (data and > structure) a MSAcess database to Mysql, and vice versa. Anyone know? > Thanks > > Chris Yes, it's called DBTools. Google for it because it's easy to find. -- -- http://gnet.inerciasensorial.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Quotes getting screwed up in form fields
I would guess your value doesn't have double quotes around. Because what might happen is this: http://www.inerciasensorial.com.br "Monty" <[EMAIL PROTECTED]> escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > If someone enters this into a field... > >New York "City" > > and I need to re-display it in the field (if an error occurred, for > example), this is what's in the field... > >New York \ > > I have another multi-line text field that I used quotes in and this doesn't > happen with that field, even though they are both being treated in the same > manner. What am I missing? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP implementation of something like Apache's mod_speling?
How about a file wilh all the directories and you compare its contents using similar_text() or soundex/metaphone() with the url/directory that failed? Shouldn't be too hard to implement. -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br "Tim Luoma" <[EMAIL PROTECTED]> escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > As I assume most of you know, mod_speling (sic) is a feature of the > Apache httpd that will suggest possible corrections to URLs. > > i.e. if you look for /sidebar/ on my site you'll get a 404 because the > actual URL is /sidebars/ > > The problem is that some sites don't enable mod_speling and some don't > use Apache ;-) > > Before I reinvent the wheel, I thought I'd ask if anyone had written > some PHP to cover this... I didn't find anything useful in Google or > HotScripts > > TjL > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: decrypting values in MYSQL
You can't view it anymore. You can compare a string with PASSWORD('string') to see if they match. -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br "Michael P. Carel" <[EMAIL PROTECTED]> escreveu na mensagem 001101c239c1$541db6a0$[EMAIL PROTECTED]">news:001101c239c1$541db6a0$[EMAIL PROTECTED]... > Hi to all, > > How could i decrypt the encrypted data in MYSQL? > I've inserted values in mysql using the PASSWORD( $userpassword ) function > to encrypt all user password. > Example: > Insert into Users_Table set Password_Field=PASSWORD('$userpassword'); > > But i don't know how to select to view the $userpassword value. > > Is there anyone who could help? Thanks in advance. > > > Mike > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP4 and MySql - Search Results Question?
You could select everything, count the results, and just show 15 results. I am not sure that a COUNT() with LIMIT will perform the desired effect. -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br "Jason Caldwell" <[EMAIL PROTECTED]> escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I'm using PHP4 and MySQL -- > > I'm trying to write a small search engine -- got it working, however, what > I'd like to do is return the TOTAL records found. > > You see, right now I am using LIMIT within my SQL -- so I only return 15 > results at a time. > > How do I get the total (say for example there are 2000 records) -- do I need > to COUNT(*) first, then perform another SELECT query for my search? > > Or, is there a PHP/MYSQL command that returns the total records matching my > SELECT query irregardless of the LIMIT ?? > > Thanks > Jason > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] JSP vs. PHP?
[EMAIL PROTECTED] em Friday 09 August 2002 14:14 foi agraciado com uma resposta por: > but how many huge dot-coms wrote their sites in PHP? We did :-) A Linux/Apache/PHP/Mysql system that will run credit solicitations for financial institutions. Management of around 500 million dollars, yearly. But s, the people at the Evangelism mailing list are expecting details already ;-) -- Julio Nobrega http://gnet.inerciasensorial.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Thumb nail of a web page
> This would be a major task. You would have to write a complete HTML renderer > in PHP. Perhaps you can cheat and let other programs do all the work ;-) Open a page with the browser and take a "screenshot", all using php's exec(). Then trim the browser's border and toolbars using the gd module. The problem is getting to know if (and how much) you need to scroll down to see the rest of the content... -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br "Jason Wong" <[EMAIL PROTECTED]> escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Saturday 10 August 2002 05:03, Henry wrote: > > Hi All, > > > > Just out of interest, does anyone know of a way to generate a thumb nail of > > a web page given a URL? > > This would be a major task. You would have to write a complete HTML renderer > in PHP. Maybe some clever soul could write a library that interfaces to > Mozilla's gecko engine. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Nothing matters very much, and few things matter at all. > -- Arthur Balfour > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: weird urls
Well, it's a GET parameter, not a server file. Probably the file "source.php" has a command to include the file "/index.php". if (isset($_GET['url'])) { // Security check, prepend filesystem or webserver root and include($url); } -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br <[EMAIL PROTECTED]> escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > How come some URLs have all these questions marks and stuff like that? Below: > > source.php?url=/index.php > > __ > Pre-order the NEW Netscape 7.0 browser. Reserve your FREE CD and pay only $2.99 shipping and handling. http://cd.netscape.com/promo_one/ > > Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: is this possible ...
Yes, it's possible. You concatenate the form variables with the html, transform it to a file and attach to the email. -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br "M.E. Suliman" <[EMAIL PROTECTED]> escreveu na mensagem 000701c24097$044a1b00$9fb71fc4@b1s0n2">news:000701c24097$044a1b00$9fb71fc4@b1s0n2... > Hi > > I need the contents of a form to be emailed as an attached Excel file or > html file. Is this possible using PHP. I think comma delimited files open > in Excel. Can anyone advise. > > Thanks in advance > > Mohamed > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Random mirrors and download quota
Seems good to me, only this part: > and it will be checked if the mirror is randomly selected and > if it is above 1200, will randomly select another server It's better to select those under 1200 right from the start. If you have 10 servers, you might make 9 checks before selecting the last one. -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br "Andrew Conner" <[EMAIL PROTECTED]> escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > I have a script (at bottom) that, upon loading, will randomly select a > mirror or primary server (on average, the primary servers will be selected > twice as much). It all works good, but now, I have to add a "quota manager" > that will, for both mirrors, limit the times the file can be downloaded to > 1200 times (there is only one file being downloaded). I have thought about > storing a text file for each of the two mirrors that shows the current count > of downloads, and it will be checked if the mirror is randomly selected and > if it is above 1200, will randomly select another server, and if it isn't, > will just add one to it and update the file. How would I go about this, or > is there a better way to do this? > Thanks in advance. > Andrew Conner > > The script (I know it doesn't use the best design, but it works, any better > ways of doing this?): > > > // This array holds the servers, and has a double entry for the primary > servers > > $adArr = array("http://www.someprimaryserver.com/file.exe";, > > "http://www.someprimaryserver.com/file.exe";, > > "http://www.someprimaryserver2.com/file.exe";, > > "http://www.someprimaryserver2.com/file.exe";, > > "http://www.someprimaryserver3.com/file.exe";, > > "http://www.someprimaryserver3.com/file.exe";, > > "http://www.someprimaryserver4.com/file.exe";, > > "http://www.someprimaryserver4.com/file.exe";, > > "http://www.somemirror.com/file.exe";, > > "http://www.somemirror2.com/file.exe";); > > // This randomly gets a server... > > srand((double)microtime()*100); > > $wOne = rand(0, 9); > > $choice = $adArr[$wOne]; > > // This fwds the user to the server picked. > > // Somewhere in here needs to be the mirror stuff... > > header("Location: $choice"); > > ?> > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hacker?
> What about all the users of his web site that are requesting his php scrpts > that are compiling through my server? Contact him and ask to stop. If he doesn't, block. It will be him that will lose customers, not you. -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br "Rps Internet" <[EMAIL PROTECTED]> escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > What about all the users of his web site that are requesting his php scrpts > that are compiling through my server? > > -Original Message- > From: Tyler Longren [mailto:[EMAIL PROTECTED]] > Sent: Sunday, August 11, 2002 4:15 PM > To: RPS Internet > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Hacker? > > > block his ip at the router. > > tyler > > On Sun, 11 Aug 2002 16:21:07 -0600 > "RPS Internet" <[EMAIL PROTECTED]> wrote: > > > My server is getting odd request form an outside computer. Upon > > looking into the requests I have found his PHP Config file is point to > > my server as the HTTP_VIA and other vars. I am wondering how I can > > deny him access since he is forwarding all request through my server > > with these settings. My server is only running ports 22, 25 and 110 so > > will his requests still run php since it is installed? > > > > > > Thanks, > > Josh Thomas > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Shared network server failing to include files
Hi all, I am not 100% sure if this is a PHP problem, so I apologize in advance if it is an off-topic problem. I have a Linux server where I develop my websites. A Windows 2000 takes care of our network internet connectivity. I need to show to a client the progress of our work, so I've shared through Samba a directory from Linux, and installed Apache on the Windows 2000 and used the Alias option to point to this Linux share: Alias /cs/ //192.168.0.253/apachedir/ When I access my development website locally, or use a browser and input the IP address, everything goes fine. But when I am on the Windows 2000 and type: http://localhost/cs/ An include error occurs: Fatal error: Failed opening required 'gerador.inc.php' (include_path='') in //192.168.0.253\apachedir\index.php on line 3 Anyone knows the fix? Perhaps I should ask what basically I have in mind since the beggining: How can I server webpages from a networked Linux through the Windows 2000 that is connected to the Internet? Any help is sincerely appreciated. Thanks, -- Julio Nobrega -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Shared network server failing to include files
Hi all, I am not 100% sure if this is a PHP problem, so I apologize in advance if it is an off-topic problem. I have a Linux server where I develop my websites. A Windows 2000 takes care of our network internet connectivity. I need to show to a client the progress of our work, so I've shared through Samba a directory from Linux, and installed Apache on the Windows 2000 and used the Alias option to point to this Linux share: Alias /cs/ //192.168.0.253/apachedir/ When I access my development website locally, or use a browser and input the IP address, everything goes fine. But when I am on the Windows 2000 and type: http://localhost/cs/ An include error occurs: Fatal error: Failed opening required 'gerador.inc.php' (include_path='') in //192.168.0.253\apachedir\index.php on line 3 Anyone knows the fix? Perhaps I should ask what basically I have in mind since the beggining: How can I server webpages from a networked Linux through the Windows 2000 that is connected to the Internet? Any help is sincerely appreciated. Thanks, -- Julio Nobrega -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shared network server failing to include files
@ Edwin em Wednesday 14 August 2002 14:51 foi agraciado com uma resposta por: > And still, if this doesn't work, why not install PHP as well--with > Apache... (Perhaps, there must really be some good reason why not...) Yes ;-) It connects to 12 different mysql databases and has a few Linux-only tweaks. > > I'm not sure what was meant by> >> > A Windows 2000 takes >> > care of our network internet connectivity > server? I meant our Adsl modem is connected to the Windows 2000 machine, and the rest of the network use it. Anyway, now I am 100% it's a php configuration issue because HTML pages are served normally. The problem is when I use require() (and similar) functions. It can't find the files. I've edited php.ini and used .htaccess to specify the include_path() but no luck yet... Still researching! -- Julio Nobrega http://gnet.inerciasensorial.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Drop down reload
http://www.zend.com/zend/tut/drop-down.php -- Julio Nobrega Me empurraram pra chegar lá mais rápido! http://www.inerciasensorial.com.br "Christian Ista" <[EMAIL PROTECTED]> wrote in message 000201c2451b$94fe4300$c000a8c0@p3portable">news:000201c2451b$94fe4300$c000a8c0@p3portable... > Hello, > > Could you tell me if it possible to reload the current page when I > select a value in a drop down ? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Cleanup script
> I just had a massive open house party... > > Is it possible to write a PHP script to collect all the bottles and > cans, mop the floor, fumigate the carpet and make me lunch? PHP is all. You need. -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br "Liam Mackenzie" <[EMAIL PROTECTED]> escreveu na mensagem 001f01c24644$71cf59d0$0b00a8c0@enigma">news:001f01c24644$71cf59d0$0b00a8c0@enigma... > I just had a massive open house party... > > Is it possible to write a PHP script to collect all the bottles and > cans, mop the floor, fumigate the carpet and make me lunch? > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ~off: Discovering what values start and finish x% of the records
Hi All, I have Mysql records (timestamp) that represent when a document has shifted flows in a workflow system. Access to documents are restricted based on what flow the document currently is and what user group is trying to access it. User groups are a combination of usernames and actions. Actions are mostly "read, write, modify, delete". [1] So far, so good. I need to find what is the average time that a flow is completed and predict how long a document will take to reach the next flow. But each user group access the system on different times of the day, even different days of the week. Usually, users of an user group will access the document at the same time (for example, 8:00 - 17:00 on weekdays), but some groups with several users might 8:00 to 22:00 or even work on weekends. My clients system admins will be free to create users, groups and workflows, so I can't hard-code that a flow usually will start at a value and end in another[2] to find the average time or to predict when the next one will start. My best try is to find the Mysql timestamps of when a flow starts and end most of the time.[3] So I am looking for a way to discover what values start and finish 90% of a paricular set of flow records, and work with these values between flows. I've tried to use some statistics formulas: 90% = 1.65 [4] 1.65 = ($start - AverageValue) / StandardDeviation Which translates to: $start = AverageValue + (1.65 * StandardDeviation); But $start always comes up with values not present on the Mysql database, because timestamps can have erratic values between each other. And a friend warned me that if an user group that usually works between 8 - 17 has an user that works 15 - 23, the StardardDeviation will not work as predicted, having erratic values too. So I am open to any suggestions, since I've lost my afternoon on this problem. Any advice is appreciated, and sorry for my english (I am from Brazil). Many thanks, -- Julio Nobrega http://www.inerciasensorial.com.br [1] = Sorry if the intro was too long. [2] - And I can't ask my clients to do it for me :) It would be easier, but I can't. [3] Is it really? I am really open to new ideas. [4] = According to http://caripi.cultura.ufpa.br/dicas/biome/tabe/biotaz.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multiple Inheritance Emulation
I don't fully understand OOP, so my snippet might be wrong. But I need to emulate Multiple Inheritance for a script, so I've made the following, which I ask for opinions since I am not so sure if it will always work. class multipleInheritance { function callClass($class_to_call) { return new $class_to_call(); } } class A { function insideA() { echo "I'm inside A!"; } } class B { function insideB() { echo "I'm inside B!"; } } class C extends multipleInheritance { function insideC() { $a = parent::callClass('A'); $a->insideA(); $b = parent::callClass('B'); $b->insideB(); } } $c = new C(); $c->insideC(); -- And it echo: I'm inside A! I'm inside B! -- Julio Nobrega http://gnet.inerciasensorial.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Multiple Inheritance Emulation
Julio Nobrega em Friday 27 September 2002 15:40 foi agraciado com uma resposta por: > I don't fully understand OOP, so my snippet might be wrong. But I need to > emulate Multiple Inheritance for a script, so I've made the following, > which I ask for opinions since I am not so sure if it will always work. Er.. list, nevermind. What I did doesn't make any sense at all. Sorry for wasting everybody time and bandwidth. -- Julio Nobrega http://gnet.inerciasensorial.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Storing images in MySql
From the mysql manual (http://www.mysql.com/doc/T/i/Tips.html): "When using a normal Web server setup, images should be stored as files. That is, store only a file reference in the database. The main reason for this is that a normal Web server is much better at caching files than database contents. So it it's much easier to get a fast system if you are using files." I guess Mysql developers are a good reference ;-) -- Julio Nobrega. Tô chegando: http://www.inerciasensorial.com.br "Mike Fifield" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > After posting my question about performance earlier this morning it was > suggested that I also store the jpg's in the database, (thanks Maxim). I did > a little research and got a lot of conflicting information on weather this > is a good idea or not. For example the following url states that you suffer > a 30% performance hit by doing it this way. > http://www.zend.com/zend/trick/tricks-sept-2001.php > <http://www.zend.com/zend/trick/tricks-sept-2001.php> > Is anyone out there running a website that stores images as binary data in > MySql that could comment on this? > Any and all comments are welcome. > > Mike > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: CMS -- central module handling
Hi! I have tried to make a complete modular php cms system. The hardest part was not selecting which modules to load, but their presentation. I don't know if what I did was good enough, i.e: the best implementatin, but somewhat was working. What I did was basically query a Mysql table, selecting rows with this information: area_id area_style area_modules "area" was a part of a what I called in my system "canvas". A canvas is the page, and each "area" was the position of the module in the screen. So: area_id = 1 area_style = '' area_modules = "system/articles/[module]system/stats/[module]user/forum/" So I would do: while(list($idarea,$area_style,$area_modules) = $area_sql_result()) { ?> http://www.inerciasensorial.com.br "Lauri Vain" <[EMAIL PROTECTED]> wrote in message 000301c1e856$f357e5e0$1431a8c0@tharapita">news:000301c1e856$f357e5e0$1431a8c0@tharapita... > Hello there, > > I'm seriously researching some aspects of writing a content management > system that would be 'relatively' easy to extend. > > My biggest problem is the ground level -- how should the central system > (that registers modules) work? Ideally, it should be possible to easily > extended the system -- running the install.php file (or something > similar) will tell (insert new database rows or will add new rows to the > configuration file) the central module that a new module was just added > and also gives instructions, how to use it, with which other modules it > integrates and where the new files are. > > The basic idea is that modifications to existing files (modules) > shouldn't be made (except the central module, which handles all others). > Each module should be totally *independent*, but should still integrate > with the rest of the modules (when marked as possible in the database). > What I mean by 'integrate' is the following: there are two modules, for > example, "image gallery" and "articles". Both of them should appear in > "What's new" part (when the appropriate checkbox will be checked). Also, > it would be nice when one could choose the option "Publish to articles" > when inserting a new image gallery (a client event for example -- story > in pictures). Yes, that's a simplified example. > > So, the problem is that there might only be the "article" module at > first. Later, the "articles" and "What's new" module will be added and > all three of them should now work together. I hope you catch my drift. > > I have quite a few ideas, but I'm sure that our team is just > re-inventing the wheel. What are your experiences? Are there any good > books on the subject of creating an extendable content management system > (preferably from the coders point of view, but not language-specific). > > Thanks, > Lauri > -- > Tharapita Creations > [server-client web applications] > [EMAIL PROTECTED] > Mobile: +372 53 410 610 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Comments Display, with replies
Hi list! I have maybe an easy to solve problem, but I haven't come with a logical way to do it. I am builing a discussion site (a la Kuro5hin.org), and there's a sql query to retrieve comments attached to an article. It grabs their titles, along with some more informatio. What I want is to display the comments and the replies below them. It's been implemented in thousands of other scripts, but I can't figure out how to do with only one sql query (even if it uses Joins). That's important, since I expect the site to be very popular here in Brazil (let's hope!) So, any advices about how to display the comments like this: - Comment 1 - Comment 2 - Comment 3 Is greatly appreciated. I am thinking about storing all comments in an array and construct the layout from there. But still, I don't know if it's the best choice in performance terms. Thanks, -- Julio Nobrega. Tô chegando: http://www.inerciasensorial.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: To store or not to store . . .
Store a link to the file! Mainly because filesystems are designed to store, er.. files ;-) There's a note on Mysql's manual, under Optimizations, that recommends this. -- Julio Nobrega. Tô chegando: http://www.inerciasensorial.com.br "Php List" <[EMAIL PROTECTED]> wrote in message 051c01c1ebea$165b2070$[EMAIL PROTECTED]">news:051c01c1ebea$165b2070$[EMAIL PROTECTED]... > Hi, > I was wondering about the following: > Should I store a picture directly in a MySQL table? Or just store the link > to a file on the system somewhere? > > I would think that leaving the picture as an actual file and just storing > the link would be quicker. But what are the dis/advantages of storing right > in the table? I like the idea of not cluttering up my file system. Pictures > would only be about in the 20K range. > > Thanks, > Chris > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Redirecting
Send head()ers before any html output (including spaces or newlines before http://www.inerciasensorial.com.br "Liam Mackenzie" <[EMAIL PROTECTED]> wrote in message 006801c1ed9e$1fddf4a0$0400a8c0@enigma">news:006801c1ed9e$1fddf4a0$0400a8c0@enigma... > Hey all, > > Just curious as to what the best way is to move someone off your site, apart > from bringing up a picture of male pornography... > > Seriously, I've tried using > header("Location: http://www.php.net/";); > but it returns an error saying that the headers are already set. > > The situation I'm in is as follows: > > Need to send a user to http://www.examplesite.com/ from a PHP script in > http://forums.examplesite.com/ > > > Thanks for the help > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php beginner
echo "My Name is " . $_GET['myName'] . "\n"; Specify where myName is from! It's coming from GET method, in other (simplistic) words, from the url. -- Julio Nobrega. Tô chegando: http://www.inerciasensorial.com.br "Paras Mukadam" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I'm using this simple command in my PHP script : > echo "My Name is " . $myName . "\n"; > > I'm invoking the php page by the command > http://localhost/testing/test.php?myName=Paras > > I'm getting eoor : > Notice: Undefined variable: myName in c:\apache\htdocs\testing\test.php on > line 12 > My Name is > > > Please help. > Regards, > Paras. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Creating a installer...
www.phpbb.org has one. Basically creates a bunch of database tables and modify a few files. -- 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 "Sascha Ragtschaa" <[EMAIL PROTECTED]> wrote in message 7208FD73D511B7040050BF68EF1E027AAC@unallocated-see-rfc1918">news:7208FD73D511B7040050BF68EF1E027AAC@unallocated-see-rfc1918... > Just curious to know if someone already has a approach on that... > > Are there any experiences on a installer for php projects? > > Sascha Ragtschaa > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP 4.1.2 binary for windows
If you are looking for the security patch (I believe the only reason 1.2 was released), don't worry, the bug doesn't affect Windows. Unless there are other changes? -- 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 "Charlesk" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Does anyone know when this will be available? > Or if it already is, where it can be downloaded? > > Thanks > Charles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php, text file, and mysql
Hi, just two quick notes: About text and similar fields: http://mysql.com/doc/S/t/String_types.html About not storing images: http://mysql.com/doc/T/i/Tips.html (close to the middle). That's it :-) -- 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: Calling a javascript function?
Maybe not the way you have imagined, but either you do it outside php (out of ) or you echo it. -- 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 "David Johansen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Is there any way to call a javascript function from inside a php script? > Dave > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Calling a javascript function?
Like I said: somejavafunc(); -- 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: More fun with sessions
From all users on your site? I guess only if you open the directory where the session files are stored. And loop through the files, opening each one and interpreting the contents. -- 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 "James Taylor" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > How can I get a listing of all currently active sessions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [newman] Whats wrong with this MySql Statement?
mysql_query("UPDATE access SET accessVIEW = accessVIEW+1 WHERE accessIP = '$proxy_ip'"); Singles quotes around $proxy_ip? -- 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 "Philip J. Newman" <[EMAIL PROTECTED]> wrote in message 001301c1d21b$61c42900$0401a8c0@philip">news:001301c1d21b$61c42900$0401a8c0@philip... mysql_query("UPDATE access SET accessVIEW = accessVIEW+1 WHERE accessIP = $proxy_ip"); is there anything wrong with this? Philip J. Newman PhilipNZ :: Design Solutions http://www.philipnz.com/ [EMAIL PROTECTED] ICQ# 20482482 +64 25 6144012 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Tool to remove comments??
There's an php obfuscator, http://pobs.mywalhalla.net/, and one of the options is to remove comments. -- 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 "Oliver Heinisch" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi Folks, > does anybody know a tool for removing comments out of PHP scripts? > > I mean // this is a comment > and /* this is also a comment */ > > it should also handle something like > echo'http://somewher.somecom/somepage'; // this goes to somewhere > and multiline comment like > /* > ..blah > */ > maybe anybody has an awk script, that he/she will share with me. > TIA Oliver > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Include Error on PHP 4.1.2
ini_set ('include_path', '/new/path'). Change '/new/path' to (usually) your website root. Beleza? ;-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca "Alberto Wagner" <[EMAIL PROTECTED]> wrote in message LI41WQTNUO1TTQHGHBGEGBBAWVWUB0E.3ca4d9dd@alberto">news:LI41WQTNUO1TTQHGHBGEGBBAWVWUB0E.3ca4d9dd@alberto... > I can't include anything on my php scripts > > Failed opening 'Pagina_Inicial.php' for inclusion (include_path='c:\php4\pear') > > How to fix it? > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Find if a html tag was closed
Hi all, I am trying to build a regex to check if an array of allowed html tags were closed. For example: Wrong: text Should give me something like: Tag was not closed. Here's what I came up so far: $tags_to_check = Array('a','b','i','p'); foreach ($tags_to_check as $tag_check) { if (eregi("<". $tag_check . ">(.*)[^]",$_POST['form_field'])) { ?> Tag '); ?> not closed http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Has anyone looked at phpinfo today?
Also the last question from this page: http://www.php.net/license/ If what the guy is holding in his mouth is really this... -- 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 "James Cox" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > the php daemon. > > -Original Message- > From: lmlweb [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 02, 2002 2:50 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: Has anyone looked at phpinfo today? > > > who the heck was that :) > > "James Arthur" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED]... > > > > > > Notice anything different? > > > > --jaa > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTML Character Parsing
I have this class, comes close to what you want. Feel free to modify, sorry I didn't have the time to comment it yet. I hope you can understand and use it :-) Anyway test it and see what it does. class InseForm { function AllowedTags() { $allowed_tags = Array(); $allowed_tags[''] = ''; $allowed_tags[''] = ''; $allowed_tags[] = ''; $allowed_tags[''] = ''; $allowed_tags[''] = ''; return $allowed_tags; } function FilterTags($text) { $text = strip_tags($text, ''); $text = ereg_replace("]+href *= *([^ ]+)[^>]*>", "", $text); $text = ereg_replace("<(/?[[b]r?|i|p|a])[^>]*>", "<\\1>", $text); return htmlentities(stripslashes(trim($text))); } function CountAllowedTags($text) { $missing_tag = ''; foreach($this->AllowedTags() as $open_tag => $close_tag) { $nr_open_tags = substr_count(strtolower($text), $open_tag); $nr_close_tags = substr_count(strtolower($text), $close_tag); if ($nr_open_tags > $nr_close_tags) { $missing_tag .= 'A tag ' . htmlentities($open_tag) . ' was not closed!'; } } if (!ereg("^[[:blank:]]*$", $missing_tag)) { return '' . $missing_tag . ''; } else { return false; } } } -- Julio Nobrega. Tô chegando: http://www.inerciasensorial.com.br "David" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all, > > I have a textarea which will containg info from the user. This then > needs to be parsed through something like htmlspecialchars() or > htmlentities(). > > The issue is that my system really needs to do the following: > > 1. Accept the info > 2. Check if there is any HTML syntax (, etc) > 3. If YES: remove anything that might be harmful (eg FORM, etc) > 4. If NO: Add replace CR/LF with > > The idea is that normal formatting such as , , , is > ok, but I do not want off illegal stuff. I want something a little like > Slashdot's stuff. > > Easy?? anyone know anything about this? > > Thanks > > David R > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: alphabetizing titles when first word begins with 'The','A',etc.
I would go with this. If there's a title like: "A title begins with a vowel". I guess it's better to store: "title begins with a vowel, A". Now how to transform INSERT-SELECT to a temp table where you will format, delete the original's records, and INSERT-SELECT from temp to original... -- Julio Nobrega. Tô chegando: http://www.inerciasensorial.com.br "Analysis & Solutions" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > On Wed, 12 Apr 2000, Steph wrote: > > > > > Hi. Im using MySQL and as part of my tables I have titles (of stories). My > > > question os in regards to outputing those titles. Some of the titles begin > > > with words such as 'The', 'A', 'An', etc. Is there a way to order these > > > particular titles based on the second word in the title?? > > Why not do what libraries do. Store the data correctly in the first > place? > > --Dan > > -- >PHP classes that make web design easier > SQL Solution | Layout Solution | Form Solution > sqlsolution.info | layoutsolution.info | formsolution.info > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTML form element
Art Biology Business and Economics" etc. etc. Note the [] after majors. Now majors is an array with the selected values. -- Julio Nobrega. Tô chegando: http://www.inerciasensorial.com.br "Brian McLaughlin" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all. > > I have a tag like this on a php-generated web page. > > > Art > Biology > Business and Economics" >etc. >etc. > > > My question is... since this is a multiple-select list, in the php script > that this form calls on a submit, how do I determine which options have been > selected? If I look at $majors, it is a string whose value is one of the > several options that were selected. > > Thanks, > > Brian > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: remembering variables between pages when using forms ...
Are you inserting the php on the hidden's value attribute? Something like: Also, this hidden input must be on a form... If you don't have a 'submit' button on the second page (I understood only the first and third pages are forms), you either could put an 'onunload' javascript event on the tag to submit the form or register it on a session, to later retreive it anywhere you would like (i.e, the third page) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca "Baker Downloads" <[EMAIL PROTECTED]> wrote in message 000401c157ef$cf9f2c00$[EMAIL PROTECTED]">news:000401c157ef$cf9f2c00$[EMAIL PROTECTED]... > i hope i can make my question understood ... > > i've input a value $city in my form, and i can retrieve it on the following > page (the page which was the "action" of the form) ... but then, when i try > to use a "hidden" type to move it to my next page (which is a form), i lose > the value ... i cannot access it from a page within the form ... > > does that make sense? if so, can anyone help? > > thanks in advance. > > ken > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: regardnig receiving mails
http://www.uebimiau.sili.com.br/ It's a script from my friend. Works with files (i.e, no database). You can analise his code, modify, fork, improve (that I know he would like ;-)) at will. -- Julio Nobrega. Um dia eu chego la: http://sourceforge.net/projects/toca "Nigam Chheda" <[EMAIL PROTECTED]> wrote in message 006e01c15d43$63351620$26a8a8c0@bravo">news:006e01c15d43$63351620$26a8a8c0@bravo... > > Hi > For sending mail php has a function mail() > But how to receive mails(i.ie. POP3 access) > can anyone send some sample code > pl reply me mail at following id > [EMAIL PROTECTED] > > > Nigam > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Does unset() help performance?
Hi All, If I unset variables/arrays/etc, that I will not use on my script anymore, should I expect a performance increase? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: How to determine a valid Date
checkdate(); http://www.php.net/manual/en/function.checkdate.php -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca "Carlos Fernando Scheidecker Antunes" <[EMAIL PROTECTED]> wrote in message 009e01c16013$d2627ec0$0a505ad1@Nando4">news:009e01c16013$d2627ec0$0a505ad1@Nando4... Hello all, Is there any built-in function to determine a valid date? If there's not I will have to translate one that I've wrote with DrScheme to PHP. I just want to save time :) thanks again, Carlos Fernando. Linux User #207984 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Zipping a folder on a win2000 server with php4.06
Well, you could use exec(); or system(); to call a command line zipping application to compress the directory. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca "Stefan Rusterholz" <[EMAIL PROTECTED]> wrote in message 003701c1614b$2ab8cc40$3c01a8c0@quasimodo">news:003701c1614b$2ab8cc40$3c01a8c0@quasimodo... Hi Does someone out there know, how I can zip a folder with some files in it? It should be readable for Winzip. Enviroment: Win2000 Server. VB was available if useful. Additional Components (applications, dll's or whatever) could be loaded if needed. I didn't find a usable entry in the manual, so if you tell me to rtfm - please point me to the corresponding entry also :) Thanks in advance Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP-arnings
Yeah, I got these kind of warning when I set error_reporting(E_ALL); Anyway, this shouls do it: The point is when you get 'non defined var', just define it before, even empty (i.e, $x = '') or check it with isset();.. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca "Harald Witt" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > I have a hopefully simple problem. Look at the following simple script: > >if ($x) { > echo $x; > } > ?> > > This script runs properly on my productive system (Linux, Apache, PHP > 4.0.3pl1). But on my Development-System (W2k Server, Apache 1.3.20, PHP 4.0.6) I > always get a Warning, that variable x in not definded. > Ok, thats true. But how can I suppress that Messages??? They destroy my > HTML-Code. I've searched in the PHP.INI file, but I can't find anything, that > looks like warning-suppression. > > Thanx for your help > > Harald > > -- > GMX - Die Kommunikationsplattform im Internet. > http://www.gmx.net > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: odrer by alphabet
SELECT column FROM table ORDER BY 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=1767 "Rambo Amadeus" <[EMAIL PROTECTED]> wrote in message 001c01c17c69$87eab200$c181c7d9@com">news:001c01c17c69$87eab200$c181c7d9@com... > hi, i have about 100 names in my database. How should i list them by > alphabet. > > Thanks > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Scripts to provide free emails
You can always see more at www.hotscripts.com/PHP But here's one from a friend, people seem to like it: http://www.uebimiau.sili.com.br -- 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=1767 "Tshering Norbu" <[EMAIL PROTECTED]> wrote in message 012501c17d3e$ac090080$[EMAIL PROTECTED]">news:012501c17d3e$ac090080$[EMAIL PROTECTED]... Hi list, Anyone got or know scripts to give free email accounts? I work in ISP and am thinking about giving free emails to people. Thanks a lot in advance. NOBBY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Only one instance of a script at a time !
Another idea, run a script that opens a file and flocks it until it's executed. I am sorry if this is dumb as I have little experience on locking files, but, I guess if it's locked it won't get opened again and executed (via include() or eval()); -- 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 "Jerry Verhoef" <[EMAIL PROTECTED]> wrote in message 1CDA86C6527BD311B91F0008C784121003D551DF@ugbiex1">news:1CDA86C6527BD311B91F0008C784121003D551DF@ugbiex1... > Pseudo code: > > check if pid file exists > yes -> DIE > no -> write pid file > > At end of script > delete pid file > > Jerry Verhoef > > -Original Message- > From: Nicolas Guilhot [mailto:[EMAIL PROTECTED]] > Sent: Friday, December 28, 2001 3:32 PM > To: Php General MailingList > Subject: [PHP] Only one instance of a script at a time ! > > > Running a php script with a cron job, how can I do to have only one instance > of the script running ? > > Thanks for any answer. > > > Nicolas > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > The information contained in this email is confidential and > may be legally privileged. It is intended solely for the > addressee. Access to this email by anyone else is > unauthorized. If you are not the intended recipient, any > form of disclosure, production, distribution or any action > taken or refrained from in reliance on it, is prohibited and > may be unlawful. Please notify the sender immediately. > > The content of the email is not legally binding unless > confirmed by letter bearing two authorized signatures. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: How to desactivate some functions ?
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]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > > please anybody know how to desactivate any function as mail or function to > show the source of a php page ? > > Thanks ! > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP dependent on connection speed?
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 execution time could be affected based on the connection speed. Like, 10 seconds for modem users and 2 or 4 seconds for cable connections. But I have never seen a script that would use this technique... -- 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 "Charlesk" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Is the php engine slowed by users with a slow connection? > > Charles Killmer > NetgainTechnology.com > IIS 5.0 Win 2000 Server PHP 4.1.0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] From 4.1 to 4.04pl1
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 it's not a var that existed ($_POST, $_SESSION, etc...) and different scope. I have a main file where maybe I can do $_POST = $HTTP_POST_VARS. But I can't scape from the scope problem. Anyway to make $_POST/$_SESSION/etc global on all functions on all files? -- 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 General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] if() Load a different php.ini
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 host and load the new php.ini, while I work with the old settings. Anyway to load a different php.ini (using if($HTTP_HOST)), or what settings should I change to accomplish compatibilty with two 'project versions' on alternate php versions? (4.0.6 and 4.1.0); Any ideas? Many thanks, -- 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 General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: E-Commerce
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? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP vs. ASP
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 somewhere. Like "int var = 10" Overall, how fast developers fix bugs is also a good thing... I remeber I have seen bugs corrected on PHP only after 15 being reported.. I have never programmed on ASP, these are just stuff I heard in some places... So sorry for the lack of objectiveness (spelling on that? :-)). -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Newbie
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 write more code (of if/else { SELECT/INSERT/UPDATE/DELETE), and the performance overhead of so many db queries might not be a good idea. Can't afirm 100% since I don't know your complete enviroment, but from what you told and my personal experience, I would go with 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 "Kevin P" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi > > I am trying to keep information that is input via a form. This form may be > used 1, 2, 3, 4 or more times for each entry. Meaning that the form will be > filled out and added then another of the same form filled our and so on > until the person clicks the the complete button. > > Can I hold this info by session or do I have to insert it into the database > after each time? I would rather not put it into the database until the > session is complete and they have a chance to verify their entry. > > Thanks > Kevin > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP vs. ASP
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. -- 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 General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Redirection and Passing Data (arrays)
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 message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > hi > > may can some body help me > > I'm writing a shopping cart system where the user can search for a product. > the search result is a page with number of items where the user can select > some them using checkboxes and enter the quantity that he needs, then add > them to his shopping cart this works fine when his logged in but when he is > not logged in, after the search and selecting the items when he comes to add > them to the shopping cart a login screen appears where he enters his login > user/password his shopping cart appears. > > the problem is that the items that he selected in the result page are not > passed after his login so how can i pass these arrays of checkboxes and > textfields with the login script. > > thanx for your help > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Sound File Available???
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? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 "Randum Ian" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi there, is there a way of checking a directory for a sound file showing one image if its available, another if it isnt? The sound files are in directory http://www.foo.com/media and they are called 1234.rm. Can anybody help me pls? Cheers in advance, Ian. DJ / Producer / Webdesigner [EMAIL PROTECTED] - 07814 364277 (new number) Webmaster: http://www.randumian.co.uk Webmaster: http://www.danceportal.co.uk Webmaster: http://www.vivienmarkey.com Webmaster: http://www.yamnd.org.uk Webdesigner: http://www.vgland.co.uk Webdesigner: http://www.allstargambling.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP & image rollovers question...
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 "
[PHP] Re: HTTP_IL_PAD global variable?
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]... > What does this global variable stand for? > > HTTP_IL_PAD > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Scripts keep refreshing
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 chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Feature Suggestion
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 PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > If this is the wrong place for it, please point me to the right place. > This is real small, though.. I'd like to see a shorthand for defining > arrays.. for example > > $ucase_alphabet = array(['A'..'Z']); (creates an array of all alphabet > characters, uppercase) > $numeric = array([1..100]); > > Or something of that sort. Just something that popped into my mind. PHP > feels like a language that has been built on little suggestions like > this, so I thought I'd post it. :) > > Mike > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Content Management
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. -- 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 "Erik Price" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > On Wednesday, January 30, 2002, at 02:19 PM, [EMAIL PROTECTED] wrote: > > > Does anyone know of an organization who has built and maintains a web > > content management application for a large site? > > > > > > Zope. > > > > > > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: add on's to php
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 008001c1aa6b$089d8c90$0301a8c0@CONFUSED">news:008001c1aa6b$089d8c90$0301a8c0@CONFUSED... > Hey, > I was wondering, if it would be possible to work on a "add on the fly" > approach for php modules like zlib, imap, gd etc. There are a lot of people > who dont compile these in there installation by default, which makes it very > difficult to work on programs which utilize these modules. Coz there are a > lot of ppl who are fussy abt recompiling php all the time. > > Do any of you guys face these problems? or is it just me? > Regards, > Kunal Jhunjhunwala > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: HowTo Send HTTP POST from Within Scrip
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 functions and curl module ones). -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca "Gabriel Richards" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi eveyone. > > I'm trying to build an application to interface with UPS Online Tools > server. I have to send it an XML formatted request via HTTP POST, and I'm > not sure how. > > Normally, PHP receives such requests when a user clicks a button on a form I > created, but how do I initiate a POST from with a script? Better yet, how do > I get the response? > > Thanks for help! > Gabe > > - > Ender Technology Corp. > Websites, Database Applications, Hosting > (310) 516-7411 > [EMAIL PROTECTED] > http://www.endertechnology.com/ > > - > Ender Technology Corp. > Websites, Database Applications, Hosting > (310) 516-7411 > [EMAIL PROTECTED] > http://www.endertechnology.com/ > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is this possible?
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: \n"; echo " \n"; ?> IMHO would be better: Seems to be easier to type, prettier and faster Just a tought ;-) -- 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: !isset ??
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 where I tested); -- 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 "Erik Price" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hm. I hope I'm not opening an old wound: > > Curious about the proper way to test for the existence of a variable, I > decided to read up on isset() at php.net's function manual pages. It > seems at first to be a way to test whether or not a variable has been > set. > > But reading the annotations below the documentation is mind boggling. > Back and forth, it seems to go -- and then to find out that one method > is to be used to test for POSTed variables, and another to be used for > GETted variables (for $_POST, use "$_POST['var'] !='' ", and for $_GET, > use "!isset($_GET['var'])"). > > Pretty confusing. Can anyone shed some light on whether or not there is > a final definite way to do this? I've used (!($_POST['var'])) with no > problems in the past, but does good coding style suggest that I use > (!isset($_POST['var'])) now? > > > Erik > > > > > > > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Link Inquiry
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/wishlistclient.asp?wlid=664176742884 "Lerp" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi there, been thinking about how to retrieve all links on a webpage. How > would I go about grabbing all links from a particular page? > > Thx Joe :) > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using functions before they're defined
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 development, sources, module development, etc... I mean, if you want to know how it's done internally to change or take advantage of those resources, I guess php.dev mailing list is a better place. -- 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 "Brad Harriger" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > How does PHP 4 locate function definitions if the function is called > before it is defined? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Simple for you, not for me
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 "Ramin Berwers" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > A simple question for you, but I can not find the solution. > > My source: >include("http://204.227.127.33/awc/fltfldr/6443.txt";) > ?> > > The result: > http://www.sportvliegen.nl/test.phtml > > If you watch the original document: > http://204.227.127.33/awc/fltfldr/6443.txt > > I would like to have the original document in my HTML-code. Does you have > the solution? > > Please, email to [EMAIL PROTECTED] with your answer. > > Thank you very much, > > Ramin Berwers > > > -- - > Pilotassistance > Mail : [EMAIL PROTECTED] > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > Pilotassistance bestaat onder andere uit: > www.pilotassistance.com /-.be/-.nl - Algemene site Pilotassistance > www.sportvliegen.com /-.be/-.nl- Vluchtvoorbereidingsinformatie > www.privevliegen.com /-.be/-.nl- Vluchtvoorbereidingsinformatie > www.vliegplan.com /-.be/-.nl - Indienen vliegplannen bij FIO Schiphol > www.pilot-logbook.com /-.be/-.nl - De online pilot-logbook voor de vlieger > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: help with PHP global array
$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/wishlistclient.asp?wlid=664176742884 "Wee Chua" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all, > How can I declare a global array? Can I do this: > $global myArray[] > > would I find out it is an array when I use it in other places? > > Thanks, > Wee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: block and
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 search will do fine. PS: I don't know if you know this, but it's impossible to prevent keystrokes with PHP (since it's server side), unless you go really crazy and exec(); a program to do so. -- 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 "Baloo :0)" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > I have a routine to administrate a cybercafe with MySQL, PHP over Win > 2K. > > Does anyone knows how could I programm a routine to request ID and > Password wich disables the , and > ? > > Thanks in advance, > > Alfredo > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] error_reporting(E_ALL) and undefined vars
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? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] error_reporting(E_ALL) and undefined vars
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.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: good practice
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'] == 'somepage.php') { if (isset($_POST['submitdata'])) { dosomething; } } I also don't like to exit(); programs, but I don't know your whole situation, so your mileage may vary And sometimes use a } else { on expected values with some nasty error messages (just in case someone is trying to 'crack' your app). -- 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 "James Taylor" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Can someone recommend a better method for doing something like the following? > All of my programs are written like this, but it's really poor form > considering I'm not predeclaring my variables, etc. Only thing I can really > think of is to assign a value in the form a number like 1 or something, then > do a if $value == 1 {do something} but that seems kinda hokey. Here's an > example of something I'd do: > > > > > >if ($submitdata) { > dosomething; > exit; > } > >echo "\n"; >echo " \n"; >echo " \n"; >echo "\n\n"; > > ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Undefined class name
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. -- 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 "Gary" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all, > I am working at home today and have to use windows. I am trying to use > PEAR and keep getting an undefined class name for > $db = DB::connect("mysql://$user:$pass@$host/$dname"); > my include for PEAR > ini_set('include_path', 'J:\Program Files\php\pear\DB.php'); > > where did I screw up. > > TIA > Gary > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: scheduled tasks
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=664176742884 "Rodney Davis" <[EMAIL PROTECTED]> wrote in message 000701c1b65b$cdb19110$820fa8c0@BRAIN">news:000701c1b65b$cdb19110$820fa8c0@BRAIN... > Is currently anyway of doing scheduled tasks with PHP (without using > crontab)? For example, using an email script to send out e-mail > reminders every Monday or something like that? > > Thanks, > > Rodney > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: date problem
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]">news:[EMAIL PROTECTED]... > hello > > i am running into some trouble with a very basic problem. > i want to insert the current date/time into my db. i have > the field set up as a datetime field. when i submit info, > i just get a blank date, i mean it all zeros, like > -00-00 00.00:00:00. how do i insert the current datetime > into my db? i tried using a hidden field with a foramtted > gmt date value, but its not working... any help > > thanks - eoghan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Screen Scraping using PHP
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á: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 "Phil Powell" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am having to do a remote URL screen scrape using PHP in "safe-mode". What > do you recommend I do? > > Thanx > Phil > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sessions / Serialized Data
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/wishlistclient.asp?wlid=664176742884 "Devin Atencio" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > If i have a session going with PHP4 and I want to basically > pull the entire serialized data and then insert it into the > database is there a variable that contains the serialized data > or would I have to just basically read the /tmp/sess_sessid file > and then save that into the database? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error Handling Class - Any Recommendations?
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 control server errors, like 404 or 503. On Sourceforge, no projects with files, and Google returns me thousands of unrelated pages and I couldn't filter the results until they were satisfactory ;-) I understand PEAR has somekind of error control, and it's my current DB Abstraction Layer's choice. If there's a way to keep using PEAR to handle other errors, I would be very glad if someone could point me to any tutorial or documentation about how to do so, Thanks, -- 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?
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 time, you know :-D If I can't find this class, I will make one and submit it to your website, okay? ;-) -- Julio Nobrega. > Why do you want to use a bloated 800 lines error handling class when PHP > already has built-in functions to do exactly what you want? > > http://www.php.net/manual/en/ref.errorfunc.php > > Regards, > Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Error Handling Class - Any Recommendations?
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_happened, $line, $etc...); } So... class Error_Class { function LogError($method, $etc...) { if (in_array('email', $method)) { mail ('There was an error, bla bla bla', $etc...); } if (in_array('file', $method)) { fwrite('file.txt', $etc); } if ($severity == 'CRITICAL STUFF!!!') // Do everything that's possible! } } } Something like this, where errors messages and the actions I may take could be *more easily* personalized. ;-) Or maybe instead of $method and $severity and etc, pre-confifured vars, like if I pass to $error_class->LogError() an $var = '1': class Error_Class { if ($var == '1') { $this->WarningMethod('email', 'file'); } } And etc, etc, etc :-D I understand there's a lot of "etc" on my post, that's because I am still thinking about all the features that I think that would be useful on a such class... ;-) -- 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 "Manuel Lemos" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > > > PHP built-in error handling support functions are very powerful and > capable. What do you miss in them that you still need a class to handle > it? > > Regards, > Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: function returning true or errors
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 $_SESSION['error'] = 'Error!';. Then you could check for false or true with your if (custom_function()) and echo/unset the $_SESSION['error'] part. -- 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 "Erik Price" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I am writing a function that performs some actions. I would like to > return true if the actions succeed, or return an error message if the > actions fail. How should I go about it? The following code doesn't do > it, because the returned error message is interpreted as a boolean > "true" (I think that's what's happening): > > if (custom_function() == true) { > print "Custom Function succeeded!"; > } else { > print custom_function(); > } > > I would actually rather just have the error message generated by the > script that calls the function, but the function performs some logic > that determines what kind of error message to give. I was thinking of > having the function return "1" if succeeds, "2" if error code A, or "3" > if error code B, and then a switch statement could decide what to do in > the calling script -- but does this sound sloppy? > > > Erik > > > > > > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Error Handling Class - Any Recommendations?
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(), with a few twists. > Why using a bloated error handling class that what you want without > requiring 800 lines of code that PEAR error handler does? I didn't know and I kind knew it, that's why I asked for tips ;-) -- 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 "Manuel Lemos" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > Did you know that the function error_log those exactly that what you > want? > > http://www.php.net/manual/en/function.error-log.php > > Why using a bloated error handling class that what you want without > requiring 800 lines of code that PEAR error handler does? > > Regards, > Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: multiple select list
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?
$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 PROTECTED]">news:[EMAIL PROTECTED]... > Hi all, > > I often find myself creating long arrays like so > > $a = array( > a > b > c > d > e > f > r > foo > bar > etc > ... > ); > > is there an easy way I don't know about to quote those vars? Basically just > looking for an easier way to make such an array without adding teh quotes > and commas, something like perl's qw. > > Thanks! > > Jack Dempsey > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: official statement about PHP file extensions?
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 developer, if you are, I would go with the most used, .php. Even if you are not.. :-) A client or "boss" can always change webhosting services and you gotta be prepared ;-) -- 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 "Durk Strooisma" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > Is there any official statement (by php.net) about which file extension you > should use when using PHP (1, 2, 3 or 4)? I know that's server related, but > isn't there a standard? > > http://www.fatcow.com/help/php.shtml states when using PHP4, you should > use .php4. But I have the feeling that's not true. I can remember the windows > installation of PHP4 which said .phtml and .php3 were deprecated and .php > was the only alternative. > > Thanks in advance > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Backup of MySQL database
> 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/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 "Julian" <[EMAIL PROTECTED]> wrote in message 005601c1e9fb$7bc42600$45102bc8@julian">news:005601c1e9fb$7bc42600$45102bc8@julian... > Hi list!!! > > I want to make a script to do a backup of a MySQL DB and email me it. It is > posible? > > Can anybody explain me how to do the backup? > > Thanks! Julian > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Backup of MySQL database
> I think everyone is aware that there is a mysql manual, obviously if someone > is posting in this forum they have not been able to find what they are > looking for in the manual. Or simply do not have to time to wade through the > manual to find what they are looking for. Hi Mike, I am not trying to start another flame war on this subject. But I could have been harsh and just replied "RTFM", which was the perfect case for this. I don't like to answer simple questions, that the poster didn't look like searched enough for the answer. I am, and I believe you are, busy men. We're here to do the best we can, to help other people, but I believe we also expect others to act at the same level. When I see a message here, makes me wonder that the poster has searched for the answer on his own, has tried, has fought to overcome a problem. A google search, a manual word search, would give the poster the answer quickly than it took for him to type his message. Probaly saving not only the original poster, but everyone who downloaded and read the message, plus who whatever replied. Again, this is one of the oldest wars that can be fought in any newsgroups, but I couldn't not let it pass without brief comments of what is usually expected in such enviroments :-) -- 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 Fifield" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I think everyone is aware that there is a mysql manual, obviously if someone is posting in this forum they have not been able to find what they are looking for in the manual. 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 PROTECTED]] Sent: Monday, April 22, 2002 6:51 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Backup of MySQL database > 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/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 "Julian" <[EMAIL PROTECTED]> wrote in message 005601c1e9fb$7bc42600$45102bc8@julian">news:005601c1e9fb$7bc42600$45102bc8@julian... > Hi list!!! > > I want to make a script to do a backup of a MySQL DB and email me it. It is > posible? > > Can anybody explain me how to do the backup? > > Thanks! Julian > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP editor for windows
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 presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 ".Ben" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Other than notepad, interdev, ultraedit, etc (which i currently use for > editing), does anyone know of a good editor for PHP for Windows, ideally > with syntax colouring, etc? > > Cheers, > > .ben > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How do i upgrade from PHP 4.1.2 to 4.2.0?
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://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 "Sebastian A." <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > What do I have to do to upgrade from PHP 4.1.2 to 4.2.0? Do I just overwrite > all the old PHP files with the new ones or must I do something else? > > > Thanks in advance. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: What's wrong with the PHPSESSID?????
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 short form &type=" // With session_id() instead of $PHPSESSID or $SID ACTION="network_option_transunion.php?PHPSESSID=&type=" // At the last part of the url ACTION="network_option_transunion.php?type=&PHPSESSID=" -- 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 "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi! I have the PHPSESSID working on every web page except one and it baffle > me. Have anyone have this problem before? Anyone know of a way around the > problem? > > Here is what happen. On the HTML post, I use the Post String, > > -- clip -- > ACTION='network_option_transunion.php?&type=' > METHOD="POST"> > -- clip -- > > Then on the next page, after executing hte post by clicking hte submit > button. The next page failed to show the PHPSESSID on screen. But at the > top of the browser's window where hte url address and stuffs are located. > It said, > > --clip-- > > https://test.ecbi.com/transunion/network_option_transunion.php?PHPSESSID=ACD > 2BF215C0513AADDDC70AAC598EE3E&type=credit > > --clip-- > > But when I use the php echo, it spit out nothing. What I don't understand > is that it work on many other web pages except just this one webpage. > Anyone know why? > > THanks, > Scott > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Display large text fields in html
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 browser): /--\ Abba Bee Gees|V| Beethoven Coolio| ManyOptions ZillionOptions | \---/ It's an interval of choices, first the user selects the interval, which loads another select with only these "in between" entries. -- 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 "Jan Peuker" <[EMAIL PROTECTED]> wrote in message 006c01c1eb07$28d79500$7ca990d4@toshiba">news:006c01c1eb07$28d79500$7ca990d4@toshiba... > Hi List, > > I want to display large text fields if a user changes wants to, like a > dictionary. for example, a php-database generated page hosts a combobox > filled with ids, if a user changes it, a text otherwhere changes. Simple > Javascript would you say, but what's if this combobox has about >1000 > entries(every entry about 10lines of text)? The page loads and runs very > slow. But I don't want to reload the page everytime the user changes the > field. Do you know any solution? > I know a few: a) As is said, a 2nd textbox filled with value coming from > array. > b) The box is filled by a set of textfiles which are generated before > c) above but w/ layer > d) no box but an image, b/w-gif generated by php > e) inline-frameset which is reloaded > f) an applett which get its resource by getURL > g) ... > As I said, do you know which would be the best? > Thanks a lot, > > Jan > > PS. Yes, I think this is rather a PHP question. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Destroy a session var passed as an argument
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 the function is used the session variable is destroyed. A simple unset($mensagem) inside showError() gives me back this: Warning: Undefined variable: mensagem in c:\www\lib\sistema\formularios\formularios.inc.php on line 92 I would not like to put an unset() inside if (isset($_SESSION)), after the function is called, since that only adds another line in my script, and ['error'] is an array with several other values. I have tried passing it as a reference the function argument but the error persists. So: How can I destroy the session variable inside showError($_SESSION)? Thanks for any tips, -- Julio Nobrega. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Destroy a session var passed as an argument
> 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 with & in function definition and call, and didn't work. I am tired :( -- Julio Nobrega. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD: º becomes $
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 = ImageColorAllocate ($im, 255, 255, 255); $text_color = ImageColorAllocate ($im, 0, 0, 0); $horizonte = 465; $vertical = 25; $pasta = 'Pasta Nº: '; ImageStringUp ($im, 5, $vertical, $horizonte, $pasta, $text_color); ImagePng ($im,'etiqueta.png'); Outputs: Pasta N$: Searched the manual/Google but haven't found any relevant information about characters being replaced in GD... Any help is welcome, thanks -- Julio Nobrega. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php