[PHP] Re: multithreading
This might help you: http://www.faqts.com/knowledge_base/view.phtml/aid/1982/fid/58 I've also seen before an actual php script that interacts with a C program to do the same. Google for it and it will be esay to find. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Andrew Milne [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a PHP script that is run hourly by cron; I would like to make this multithreading rather than configure cron to run the script more than once per hour. Is this possible using PHP? I've tried using ticks, but it doesn't appear to work - the tick function doesn't execute more than once at the same time... I'm using 4.1.2. Any help greatly appreciated! Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Very Large MySQL Query String
Instead of uploading to Mysql, why don't you store the file at a directory and on Mysql only the path to it? Retrieving files from the hard drive is much faster than doing the same on Mysql, and also access to manipulation (insert, update, delete, etc...) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 David Bouw [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I can't seem to figure out the following. I use the http upload functions a lot, works great!!.. For some months now I have been using a small PHP program which I use to upload PDF files of scanned documents and insert them into a Mysql table.. Normally these files are small (250 kb), but I now have a PDF of 1 MB... When uploading files I run the function: chunk_split(base64_encode($binaryfile)); to encode it, this to transform the binary file to text.. (Works great!!!) When the query was called to insert the data, nothing happens, also no error from mysql... Only think I can think of is that the mysql query string is to long.. ?? (The data when encoded is about 1.3 MB of text).. This is the source code.. if (!($userfile_size == 0)) {$fd = fopen ($userfile, r); $contents = fread ($fd, filesize ($userfile)); fclose ($fd); unlink ($userfile); echo Eerste RAW: .strlen($contents); $encodes_data = chunk_split(base64_encode($contents)); $userfile_name = str_replace( , , $userfile_name); echo strlen($encodes_data). - Displays text size BR; //Works right! mysql ($databasename_boekhoud, insert mubo_boekhoud_images (data, originalname, groep, type) values '$encodes_data', '$userfile_name', '$groep', '$userfile_type')); // mysql_error(); //No error given..? } Any suggestions are very much appreciated... With kind regards, David Bouw -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Alternate To Making Form Variables Global (Clerified)
This is not the global that is meant on the update. Not the global $var that you put inside your functions. That's scope, btw. You are making a variable available inside a different scope (the function), by making it global. The global you are searching for is, like when you submit a form, a field name becomes a varible on the action page with the same name. So: input name=username... Would create a $username variable. Not anymore :-) Now you need to specify where it came from, either with $_POST or $HTTP_POST_VARS. So... action page again: $username = $_POST['username']; But, if you don't want to convert your script (and I object btw, you should ;-), you can modify a line at php.ini so variables are *globally registered* again. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Dr. Shim [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Sorry, I'll have to clerify myself a bit. I'm rather tired. :) I have a script that verifys and inserts (into and Access databse) form values. I had to make the form variables global, in order to use them in my functions. Since the new PHP is out, the script doesn't work anymore. I think its probably because of the fact that I had to make those variables global (none of the variables are being read). Does any of you have an idea about how I can fix this problem? Thanks in advance. Dr. Shim [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is there another way then to register form variables global? I just downloaded, and instlaled the newest version of PHP, and now my form script doesn't work anymore. I had to register the form variables global in the script. I'm asking, is there a better way of doing this? I've herd it can lead to possible security hazards. Thanks for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Replacing non exact strings
Hi List, Imagine a form where user can search for clients using a 'name' field. When submitted, there's a result page, linking results to another page with the client information. I need to make the terms inputted at the form bold when they appear at the client information page. Problem is: When someone searchs for Joe Doe, and the client's name is Joe Doe, I can make it bJoe Doe/b. But when the name is Joe Cougar Doe, I can't bold it (parts Joe Doe) because there's this Cougar in the middle. The result I am looking for is bJoe/b Cougar bDoe/b. So: $searched = Joe Doe; $original = Joe Cougar Doe; $final = bJoe/b Cougar bDoe/b; Any ideas about how can I achieve this result? I am currently using eregi_replace($searched, b$searched/b, $original), so that's why it only accepts the whole string. Thanks a lot, Julio Nobrega. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Replacing non exact strings
Thanks Brian, it's working! -- Julio Nobrega. Brian Paulson [EMAIL PROTECTED] wrote in message 005101c1f2af$fa59eb00$89010a0a@bpaulson">news:005101c1f2af$fa59eb00$89010a0a@bpaulson... Julio, Try this -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: why is better?
Slower, yes. But still faster than most of other web scripting languages, at least from some benchmarks I've seen. But still, who wants to code with pointers and memory management and etc when PHP do those kinds of difficult tasks, and the normal ones, while taking less time to code? If you need critical speed, code a C module. But that's not necessary, at least in some cases I have seen (the majority, I must say ;-) Coding your whole web script in C or C++ will take weeks, months, if you start from scratch. Php is designed for this enviroment, and you will get less headcaches by using it (specially maintance and portability) As usual, use the best suited hammer :-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Steve Bradwell [EMAIL PROTECTED] wrote in message 57A1618E7109D311A97D0008C7EBB3A1CBB2EA@KITCHENER">news:57A1618E7109D311A97D0008C7EBB3A1CBB2EA@KITCHENER... Hi, Sorry to bud in on this, but I was thinking about writing my next php app oop style to learn. Are you saying that It is going to be slower or poorer performance? Thanks alot -Steve the newbie. -Original Message- From: Julio Nobrega Trabalhando [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 6:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: why is better? Faster, and better interaction with the engine that runs php (and therefore other parts of the system). -- Julio Nobrega. Franky [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Why is better to write module than class? ok is compiled code so is supose to be faster, but that all? Frank [EMAIL PROTECTED] -- 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: avoid multiple submissions
Make a unique form key for every form. When someone submits, store this unique key. Don't insert another form is there's a key already there :-) Make sure it's unique, like of current time in miliseconds plus random characters, I don't know. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Rodrigo Peres [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... Hi list, There's any way to avoid a speed gonzales user to keep pressing submit button while you PHP is processing the code??? I was looking in my mysql and found some duplicate entries with a diference with seconds in the time. Thank's Rodrigo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: why is better?
Faster, and better interaction with the engine that runs php (and therefore other parts of the system). -- Julio Nobrega. Franky [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Why is better to write module than class? ok is compiled code so is supose to be faster, but that all? Frank [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Kinda HTML and PHP question....
$text = substrt($text, 0, 75) . '...'; Cuts anything beyond 75 caracthers and add ... to the end of it. Also, you could when people submit anything check for spaces if the size is greater than a number of characters: if (strlen($text) '75' !ereg(' ', $text)) { echo 'Please use spaces!'; } -- 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 Mantas Kriauciunas [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hey PHP General List, I have news thing in MySQL database... i made tables that is good to look under 800x600 and highet.. now i am outputing from database $full_news line like this: echo Full Story:br$myrow[3]brbr\n; so the problem is... like some stupid people put word...without spaces or something without them...just letters no spaces...and it doesn't warp the text. What do you think i should do at that point? What do you do in your sites to protect that? because my tables get wight bigger..they are set to wight=100% . thanks for any help or any suggestion what should i do. :--: Have A Nice Day! Mantas Kriauciunas A.k.A mNTKz Contacts: [EMAIL PROTECTED] Http://mntkz-hata.visiems.lt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP 4.2.0 + Apache 2.0.35 (W2KSP2)
Load the experimental apache2filter.dll instead. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Kirk Babb [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have copied these three lines from the php install.txt file into httpd.conf: LoadModule php4_module c:/php/sapi/php4apache.dll AddModule mod_php4.c AddType application/x-httpd-php .php and php4ts.dll is in winnt\system32. Apache freezes unless I comment out those lines. When I test php scripts from the command prompt inside the php dir. (C:\php) I see the correct output, so I know php is working (as is my install of php-gtk). Where have I strayed from the path? this worked for my install of Apache 1.3.24 and PHP 4.1.2, so I'm not sure what's going on. thanks for any and all help, Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: build array dinamicaly
$name = Array(); $address = Array(); $clients = Array('nome' = 0, 'address' = 0); $i = 0; while (list($client_name, $cliente_add) = mysql_fetch_array($res)) { $name[$i] = $client_name; $address[$i] = $client_address $clients['nome'][$i] = $client_name; $clients['address'][$i] = $clients_address; $i++; } Alguma coisa do genero :-) -- 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 Rodrigo Peres [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi list, I want to buil an multidimensional array with the results of Mysql, but I don't know how to do it. What I need is: SELECT name,adress from tbl_. array name will receive the names array adress will receive the adresses and array clientes will contain both, so when i try to access i will have something like $cliente['nome'][0] or $clientes['adress'][1] and so on. Someone can help??? Thank's in advace Rodrigo Peres -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: In Addition to [PHP] PHP Security
1) Yes, store this kind of information outside of your web-root. But I am not sure if Apache will return the source even if php's parser crashes. If you are using the module version of php, Apache should be able to re-start itself when such error is found. I believe you can setup Apache (and maybe other servers) to not start, or restart, if certain procedures are not met. If anything fails, simple doesn't start at all. I also believe php's cgi version has the same behaviour, ie: The server will try to send the request again if it crashes. 2) Sessions are identified either from a cookie, or appending the SID (or similar) at the url, or both. Anyone who has access to the temporary session files (or database, whetever you store it), can read them, altought I believe that if you can't get the list of files in there, you won't guess the actual filename (it's something like 27bf1bb8b919e7c35217f76e45f1e86a) -- 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 00f101c1efad$ef688670$7164a8c0@toshiba">news:00f101c1efad$ef688670$7164a8c0@toshiba... Sorry for answering with a new question. But, what's if, say, the PHP-Parser crashes (or a filename is changed) and Apache returns the source. How is it simply possible to store passwords somewhere a httpd-users won't see it? (e.g. in the includes-Folder, am I right?) And are session-variables send per post or does the next script reads it from the session-file so nobody can't read them? Regars, Jan Peuker - Original Message - From: Miguel Cruz [EMAIL PROTECTED] To: Jay Fitzgerald [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 8:33 PM Subject: Re: [PHP] PHP Security On Mon, 29 Apr 2002, Jay Fitzgerald wrote: Can someone point me in the right direction in determining just how secure PHP really is? What are you actually trying to find out? As far as actual security problems in PHP, where the interpreter behaves contrary to documentation when provided with extraordinary inputs, the team has been very responsive with fixes (in contrast with, say, Microsoft). If you are wondering about the security of any given application developed in PHP, well, that's up to the developers of that application. miguel -- 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: web application development question
I let them in a database and a nice administration page so people can change. There are a lot of more information that you can store, such as last time of change, and previous values (so peopel can rollback them), who changed, description of the value, related to other values, and there always someones inspired by your app, such as especific to a client, to a part of the webiste, to users, merchants (or vendors), etc -- 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]... For those of you who write web applications (in any language), what do you recommend as the best way to store arbitrary atomic data for the web application? in other words, data that doesn't really need to be stored in a relational database, as it does not really relate to anything? In the app I am working on (PHP/MySQL), there are several instances of this. One of them is: a multiplier of 1.5 is applied to any materials cost of posters ordered through my app. That is, although the materials cost to my employer is, say $0.076 per square inch, 0.114 is the amount that we charge per square inch (0.076 * 1.5). However, this multiplier could change at some point in the future, so I am hesitant to leave the number hard-coded into my page. I would rather have it stored in the database, where my employer can easily update or change it to another multiplier. But it seems awkward to create a table that simply maintains the multiplier: mysql SELECT * FROM material_multiplier; ++ | multiplier | ++ | 1.50 | ++ 1 row in set (0.00 sec) I suppose I could store a table with two columns, one being VARNAME the other being VALUE, and pull this kind of standalone data out of it, but was curious what other people do when they need to store something like this. 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] 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
[PHP] Destroy a session var passed as an argument
Hi All! I have a simple function that returns a message: function showError ($mensagem) { return 'div class=erro' . $mensagem . '/div'; } 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] 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 form tag, I didn't see the PHPSESSID part. Also, it's a good idea to use double quotes for html element properties, amp; instead of , and always echo the var instead of the short form ?=. Try a few variations: // With double quotes, amp; and ?php echo ACTION=network_option_transunion.php?PHPSESSID=?php echo $PHPSESSID; ?amp;type=?php echo $type; ? // With session_id() instead of $PHPSESSID or $SID ACTION=network_option_transunion.php?PHPSESSID=?php echo session_id(); ?amp;type=?php echo $type; ? // At the last part of the url ACTION=network_option_transunion.php?type=?php echo $type; ?amp;PHPSESSID=?php echo session_id(); ? -- 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 -- form NAME=Inquiry_Form ACTION='network_option_transunion.php??=$SID?type=?=$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 2BF215C0513AADDDC70AAC598EE3Etype=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 select 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] 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=634single=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: 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] 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: 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] Re: phpMyAdmin protection
PhpMyadmin now have somekind of authentication method. From the docs: What's the preferred way of making phpMyAdmin secure against evil access? This depends on your system. If you're running a server which cannot be accessed by other people, it's sufficient to use the directory protection bundled with your webserver (with Apache you can use .htaccess files, for example). If other people have telnet access to your server, you should use phpMyAdmin's http authentication feature. Suggestions: Your config.inc.php3 file should be chmod 660. All your phpMyAdmin files should be chown phpmy.apache, where phpmy is a user whose password is only known to you, and apache is the group under which Apache runs. You should use PHP safe mode, to protect from other users that try to include your config.inc.php3 in their scripts. -- 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 Mantas Kriauciunas [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hey PHP General List, Can anybody point me to tutorial or real good explanation site how to keep Http://localhost/phpmyadmin off for other users. I am using it to help me with MySQL database but other peaople can access it. I know there is something with .httacces but i dont know anything about that .httacces. SO please if anybody can point me to some explanation how to secure phpmyadmin or just explain bu them selves. Thank You. :--: Have A Nice Day! Mantas Kriauciunas A.k.A mNTKz Contacts: [EMAIL PROTECTED] Http://mntkz-hata.visiems.lt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: placing data outside the server root
Yes, if the user you are, and are trying to access the dir/files, also have access to them. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Andy [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi there, is it possible to place data like images outside the server root, and if so does php still get access to them for displaying? thanx, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Writing Cross DB application
There's Metabase, one said to be the most complete of them all, available at http://www.phpclasses.org/ and PearDB, available at http://pear.php.net. I am using Pear, most because it takes advantage of another shared classes from Pear itself. For example, the Log class from Pear can use Pear's Db class, and a few other things here and there (nice things, btw ;-) -- 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 Arcadius A. [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello ! I'm planning to write a database application for MySQL, and then port it to PostrgeSQL. Is there any library or class that could help me to write/maintain just one source code for both MySQL and PostgreSQL (on WIN and UNIX)? Thanks in advance. ARcadius -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Shopping Engine Recommendation
http://www.oscommerce.com/ -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Robert Collins [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Can anyone recommend a good commercial shopping cart written in php? Robert W. Collins II Webmaster New Orleans Regional Transit Authority Phone : (504) 248-3826 Email : [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: meta tags from mysql
Mysql table with a meta column and a url column: $url = $PHP_SELF; $sql = SELECT meta FROM table WHERE url = '$url'; Just select from the database a meta column depending on the url people are. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Andras Kende [EMAIL PROTECTED] wrote in message 000a01c1e4b9$293052c0$b59fb841@a">news:000a01c1e4b9$293052c0$b59fb841@a... Hello All, I looking to to generate different meta tags from mysql for each page on a dynamic site which has about 400 pages from mysql database . Searched around but didnt find anything which will give me some hint whats the best way doing it Any help appreciated :) Thanks, Andras Kende [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sessions and Opera
Cookies disabled? Or cache? Have you tried a 'fresh' Opera install or a newer version? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Steve Fitzgerald [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... While testing a login page with different browsers I noticed that Opera (vers5.02) didn't allow me access to the site despite using the correct input, so I wrote the following pages to test Opera's performance. It seems that Opera doesn't pass registered variables to the new page. IE NS both print the output as expected, but in Opera all variables are empty. Has anyone got any thoughts/solutions/experiences? regards Steve -- ## login page ?php $password = letmein; if (isset($input)){ if ($input == $password){ $auth = 1; session_start(); session_register(enter,input,password,auth); header(Location: 2.php); exit; } } ? body form action=?php echo $PHP_SELF ? method=POST Enter password: input type=text name=input brinput type=submit /form ?php print The value of \$enter is \$enter\br; print The value of \$input is \$input\br; print The value of \$password is \$password\br; print The value of \$auth is \$auth\br; ? -- ## 2.php ?php session_start(); print The value of \$enter is \$enter\br; // empty print The value of \$input is \$input\br; // should print 'letmein' print The value of \$password is \$password\br; // should print 'letmein' print The value of \$auth is \$auth\br; // should print '1' ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: skipping a WHILE loop in mysql_fetch_*()
For example: $sql = SELECT id FROM table WHERE name = '$name'; $res = mysql_query($sql) or exit (mysql_error()); list ($id) = mysql_fetch_array($res); That's it, use list() to make a variable, from mysql_fetch_array(). Very useful indeed for one line returns :-) More than one column: $sql = SELECT id, city FROM table WHERE name = '$name'; $res = mysql_query($sql) or exit (mysql_error()); list ($id_user, $city_user) = mysql_fetch_array($res); Vars inside list() can have any name you wish, just remember to put the same number as the columns in your sql query. -- 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 have always retrieved database information using the following general format: ?php mysql_connect($host, $user, $password); mysql_select_db($database); $query = select * from table; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { echo $row[user_id]; echo $row[fullname]; } mysql_free_result($result); ? But sometimes I am searching for something specific, with a primary key as my WHERE clause. In other words, I will only EVER get one result. In this case, a while loop seems to be overkill, since it will only loop once. Does it seem like a bad idea to just do: $row = mysql_fetch_assoc($result); echo $row['user_id']; echo $row['fullname']; etc? Or is there a compelling reason to use the loop? the only reason I ask is because I've never seen search query code that -isn't- in a loop of some sort. But it works fine the way I do it, immediately above. Thanks, 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: getting the 'client' date and time for use in PHP scripts ??
Still you can use Javascript. get it and reload the page appending the info on the url. Or write to a file and open with php. Or you could get what country the user is and calculate the time zones. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 David Eisenhart [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Does anyone know of a technique for obtaining the date and time of the client's system? (I can conceive of generating this with Java Script and passing it to pages within the site, but it is important that this information is obtained by the 'first' page that the user accesses.) Any ideas gratefully received. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Making sure a post request came from your site
Using sessions, $HTTP_HOST, form keys, $HTTP_REFERER, ip address, Javascript. On a session you can record the user_agent on the first page, the ip, the host, and check on the form's action page. Form keys are some number you come up and pass either via url or post, and check on the action page. The thing is to find out whetever you can check that should be fixed between page transitions or things that you can invent. Not 100%, but the more, the best. -- 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 Chris Boget [EMAIL PROTECTED] wrote in message 000701c1dccb$8b911ee0$[EMAIL PROTECTED]">news:000701c1dccb$8b911ee0$[EMAIL PROTECTED]... For security, you can modify your code so that you check the $_POST elements instead of using the magic globals. That's all well and good. However, someone copy and save your HTML to their local machine, change some values, change the Action page of the form to be http://www.yoursite.com/form_page.php instead of form_page.php. You'll be checking the $_POST elements but you won't have any idea that they were changed and posted from the user's local machine. Is there any way to determine from where the post request came from w/o using http_referer? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: help condensing regular expressions
How about: $site_root = '/www/user/htdocs/'; img src=?php echo $site_root; ?images/logo.png / Instead of going relative, go from the root. Or you could put $site_root as your url: $site_root = 'http://www.your_site.com/'; -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Tom Rogers [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi I am trying to calculate how far into a directory structure I am so that I can include images and include files without having to hard code them. I need to turn $PHP_SELF which could be /admin/emails/index.php into ../../ which I can then use to get to any directory from root. like IMG src=?echo $relative_root?images/logo.png Regular expressions leave me cold but I have come up with the following monster which works $relative_root = preg_replace(\/[[:alnum:]]+,../, preg_replace(/[[:alnum:]]+$,,strtok($PHP_SELF,.))); Anybody have a better solution? Thanks for any help. Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Emulation: $var = print_r($array)
Is there a way to do something like this? I wrote a wanna-be debugger. It just write to a file simple and common used function and variables, array or objects. Then when I activate it, a new window is opened with these information. Simple stuff. The problem is that if I do this: fwrite($fp, $_SESSION); It will record Array, of course. If I serialize it, it's unreadble compared to print_r(); $var = print_r($array), well, prints the array like I suspected. Is there a way to emulate var_dump(), print_r() so I can write it to a file and when I open this file the information are shown like if I really did a print_r();? Any help is great! :-) Thanks, -- Julio Nobrega. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Current URL, Last URL, error handling
$REQUEST_URI? If it's not the full you can complement with $HTTP_HOST or similar. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Ben Edwards [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Kind of but not quite. Was wondering if PHP help the actual full url. Ben At 15:26 04/04/2002, you wrote: On Thursday 04 April 2002 21:56, Ben Edwards wrote: Is there a way I can get the whole URL of the current page for error handling/reporting. Also is there a way of getting the previous/referrer URL for a similar purpose. Have a look at the values inside $HTTP_SERVER_VARS: print_r($HTTP_SERVER_VARS); -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Because he's a character who's looking for his own identity, [He-Man is] an interesting role for an actor. -- Dolph Lundgren, actor */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * Ben Edwards +44 (0)117 9400 636 * * Critical Site Builderhttp://www.criticaldistribution.com * * online collaborative web authoring content management system * * i-Contact Progressive Video http://www.videonetwork.org * * Smashing the Corporate image http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Current URL, Last URL, error handling
Okay, just phpinfo(); and use the variables. You can see whetever you will need there for url script construction. If you need, setup two pages with phpinfo() and a link between them so you can check for Referers (the Last Url you need) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Exit();
return; stops a function execution. Function One() { If (!$var) { return; } } -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Mauricio Cuenca [EMAIL PROTECTED] wrote in message 00f501c1dbec$d8f11e90$0201a8c0@telesat56evlre">news:00f501c1dbec$d8f11e90$0201a8c0@telesat56evlre... Hello, I'm using recursive functions and call a function from inside another one. The problem is that when I call the Exit(); function the whole program is aborted. How can I quit just the current function, not the whole program ? example Function One() { If (!$var) { Exit(); } } Function Two(); { One();//This line kills the program Print(Hello); //This is not printed =( } /example TIA, __ Mauricio Cuenca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: what should be my wishlist?
Curl, gd, zlib, sockets, pdf... pear is fine but you don't need your isp to install, can have on your own directory. Humm... if possible, no safemode() enabled :-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Adrian Murphy [EMAIL PROTECTED] wrote in message 004401c1da29$e6eb9e40$02646464@ade">news:004401c1da29$e6eb9e40$02646464@ade... Hi I'm creaating my wishlist for my php build for my isp. I've got the usual stuff gd/ftp/xml etc and was wondering what else should i ask for e.g. i've never used pear but it might be useful? curl etc. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Loop non-fixed sized array
Hi All! Here's something I am trying to do, and I don't know if it's possible. I have a function that must register session variables, values that come from an array. But each of these values will be the value of an session array, of non-fixed size. Let me explain (w and d stands for Write and Del): What I need: $_SESSION['news']['w'] = 1; $_SESSION['news']['d'] = 1; So what I am doing: $w = 1; $d = 1 $powers = ($w, $d); // This array can have an undetermined number of values function MakePowers ($area, $powers) { foreach ($powers as $value) { $area = $value; } } Now here comes the real problem, $area specifies where in the $_SESSION array I will store the power. I did $area = $_SESSION['news'] but gives me a undefined index 'news. I could define 'news' for each page of my application but that's not much function reuse :-) And $area could be, in different pages, $_SESSION['news]['admin'], $_SESSION['forum'], etc... That's my non-fixed sized array. I need to make a central function that will store in different keys of $_SESSION values that say what powers the user has, powers that come from the $powers array. ANY help? I hope I did a good job trying to explain what I am trying to do :-) Many thanks for any help, sincerely! -- Julio Nobrega. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Followup: Loop non-fixed sized array
Is there a way to make an array with only the key defined? That maybe will help me. $area = array('news' = array('admin')); print_r($area) gives me: Array ( [corporativo] = Array ( [0] = classificados ) ) The key is '0', I need key 'classificados' without a value, so I can make this: function MakePowers ($area, $powers) { foreach ($powers as $value) { $_SESSION[$area] = $value; } } But this gives me ILLEGAL OFFSET error on $_SESISON[$area]; Any help? Again? :-) -- 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 Julio Nobrega Trabalhando [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi All! Here's something I am trying to do, and I don't know if it's possible. I have a function that must register session variables, values that come from an array. But each of these values will be the value of an session array, of non-fixed size. Let me explain (w and d stands for Write and Del): What I need: $_SESSION['news']['w'] = 1; $_SESSION['news']['d'] = 1; So what I am doing: $w = 1; $d = 1 $powers = ($w, $d); // This array can have an undetermined number of values function MakePowers ($area, $powers) { foreach ($powers as $value) { $area = $value; } } Now here comes the real problem, $area specifies where in the $_SESSION array I will store the power. I did $area = $_SESSION['news'] but gives me a undefined index 'news. I could define 'news' for each page of my application but that's not much function reuse :-) And $area could be, in different pages, $_SESSION['news]['admin'], $_SESSION['forum'], etc... That's my non-fixed sized array. I need to make a central function that will store in different keys of $_SESSION values that say what powers the user has, powers that come from the $powers array. ANY help? I hope I did a good job trying to explain what I am trying to do :-) Many thanks for any help, sincerely! -- Julio Nobrega. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question on eval()
Maybe parse_str() will do the trick? I am using it in a close situation, I store: a=1b=1 And $a has value 1, $b has value 2. But I guess to work in your case you would need to stripslashes(); and str_replace(';', '', $string) before the parse_str(); -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Folks, I save an ascii-sentence, representing my vars and their values in the db after I request them, I try to eval them. here is what I get back from the db $scar=\3\;$anrede=\Herr\;$pf_name=\wert\;$pf_kontem=\tzrtzetrz\;$pf_ kontel=\zuoioopöl\;$zeit=\\;$pf_wt=\löjlköjklö\;$sto=\2\; (values are just typed in ;-) ) then I try to eval them with $tmpeval=$vars[1]; // $vars[1] is where the data is in my answer-array eval (\$tmpeval = \$tmpeval\;); after this ther should each var have it´s values like $scar should be 3 $anrede should be Herr I also tried $tmpeval=stripslashes($tmpeval); but that doesn´t work either. Can anybody see my mistake, or is there any length-limit in eval ?? TIA Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: escaping PHP's closing tags
Haven't seen it either, but you could use: echo '' . '?'; So is separated from ?. Or ? from for the matter. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Erik Price [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi -- I'm trying to use a string of XML data which includes the use of the ?xml ? tags. I've noticed that my editor (BBEdit) shows that \? will escape the tag so that PHP does not treat it as a true close the PHP code tag, but was hoping that someone here could give me an official ruling. There is no reference to escaping the ? tag on the man page (currently) that I could find, or in the annotations. 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
Re: [PHP] syntax
Make it this way: Looping first. I will loop with while: $i = 0; $array = Array(); while (list($value) = mysql_fetch_array($result)) { $array[$i] = $value; $i++; } Arrays are easier :-) Each $i will be a key. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 John Fishworld [EMAIL PROTECTED] wrote in message 001501c1d5ba$91eb6100$04010a0a@fishworld">news:001501c1d5ba$91eb6100$04010a0a@fishworld... Sorry I think I've badly explained this ! I'm getting results from mysql in a while loop but I need the results outside of the loops and so what I want to do is take the first variable from the db and rename it as variable 1 and then before the end of the while loop have a $i++; so i want $newvar_$i = result 1 $newvar_$i = result 2 so I can use them outside the loops as $newvar_1 and $newvar_2 hope that makes more sense ! Can someone please remind me what the correct syntax for this is ! in a loop and want individual $ned_1_city = blah $ned_2_city = blur I've been trying this but its wrong $ned_.$i._city = $ned_city ; thanks john -- 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: cookie problem. Not possible to set and read a cookie on the same page?
Not possible, read the manual page about setcookie: www.php.net/setcookie There's a 'common pitfall' entry saying so. Don't know why. Maybe the cookie is only written to user's disk after the page is fully loaded, maybe for security reasons. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Andy [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi there, I am wondering if it is possible to send a cookie and read it on the same page. Following environment: There is a cookie already on the machine of the client, but expired. Now I am setting a new cookie and reading it on the same page via $sess_id = $HTTP_COOKIE_VARS[$sesscookiename]; Unfortuanaelly it gives me the old session id back. After refreshing I am getting the new sessid and everything works fine. The cookie has been sent with the right value, I did dubble check it. But the HTTP_C... reads the old one. why? Thanx for any help, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT - number of chars in querystring
You could store the query somewhere, like in a database or file, give it an id, and store this id on a cookie. When the visitor returns, just grab the corresponding query using the cookie's id. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array in a Loop Question
for ($i=0;$i$_POST[count];$i++) { echo $_POST['address' . $i] . 'br'; } Concanate array key 'address' with $i -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Jeff Hatcher [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a form that gets repeated depending on number of members in a group(1 form surrounds all members). I separate the entries by assigning a count value to the names of the inputs (Ex. input type=text name=address$count value=). Does anyone know how I can pull the values back out of the $_POST[]? Example of ideal scenario that does not work: case process1: for ($i=0;$i$_POST[count];$i++) { $_POST[address$i] } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Merging Results of Queries
You can select from multiple databases and tables, ie: SELECT database.table.field, otherdb.othertable.other FROM database.table, otherdb.othertable; Even from two, three, four databases. But your queries might either get too complicated or slow. So, store the results from simpler selects, using only two databases, on temporaries tables of Type = HEAP. It's like they are 'memory tables', and faster. So you can again select from another database and from this temporary. Well, use temporary table to reduce the number of Joins :-) This is kind of a query merger done in sql... other option is to merge the individual sql queries using array_merge or similar functions. -- Julio Nobrega. Daniel Ferreira Castro [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello guys I have a database system that has many databases and many tables on each database. I am trying to create a kind of search engine to seek data all over my database. I need to know if is possible to merge the results of my queries to later show them on a table or it is easier to perform the query and print the results on a HTML table leaving the table open, than perform another query and print it on until it is all over and close the table with /table? Thank you Daniel F. Castro [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Debugging tool
http://www.google.com/search?q=php+debuggersourceid=operanum=0ie=utf-8oe =utf-8 Google good! ;-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Morten Nielsen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, Can anybody tell me if it is possible to use a debugger with PHP? And what is the name of it? Regards, Morten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: A Newbie needs help with his first Class
$DOCUMENT_ROOT inside a function, scope problems. Pass it as an argument or global, or use $_SERVER['DOCUMENT_ROOT']; -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Don [EMAIL PROTECTED] wrote in message 000f01c1d1a1$9105c9a0$[EMAIL PROTECTED]">news:000f01c1d1a1$9105c9a0$[EMAIL PROTECTED]... Hi, I'm trying to write my first class. Here is the code contained in a file called globals.php: ?PHP class Globals { var $gDISPLAY = 1;/* Display graphic - no rollover */ var $gROLLOVER = 2; /* Display graphic with rollover */ var $root_path;/* Path to document root directory */ var $relative_path;/* Path from document root to relative root directory */ function Globals($start_dir) { if ( strlen($DOCUMENT_ROOT) == 0) { $this-$root_path = /; } else { $this-$root_path = $DOCUMENT_ROOT; } $this-$relative_path = $this-$root_path . $start_dir; } } $global = new Globals(/staging_area/phase-2/); ? Within my html page, I am tesing the class by trying the following: ?php require(globals.php); echo $global-root_path . br; echo $global-relative_path . br; ? However, nothing is being written to my browser. Is there a problem with the code? Thanks,. Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: testing for blank var
if (ereg(^[[:blank:]]*$,$img_url)) { // $img_url is blank } -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Robert McPeak [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... if $img_url has a value, then I'd like to show the image, if it doesn't, then I'd like to show a message. What's wrong with my code? Am I incorrectly testing for the value? The else works fine, but not the if. Thanks! if (!$img_url) { echo bNo Image URL Entered/bbr; } else { echo img src=\$img_url\; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: checking if a link is still alive
Open a connection? Maybe fopen, dns search, ip search, anything. I just don't know which way is faster (I think it's fopen). -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Function Not Accepting Variable Values From a Form
Scope. Try to pass the values as the function reference (inside the ()), 'global' them, or use $_POST[''], from 4.1 and beyond. If you don't know what's a 'scope', there's an entry on the manual that can explain better. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Dr. Shim [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Alas, more problems with forms =) Well now, here is my problem. I have a form, method is set to post, and action is set to the same page. I also have a hidden field named form_post and it's value is 1. Underneath this form is my PHP script. ?php if (isset($form_post)) { echo Function \isset\ called. Values are...br\n Title: $titlebr\n Author: $authorbr\n Lead Actors: $actorsbr\n Poster: $posterbr\n Summ.: $summerybrbr\n\n Rev.: $reviewbrbr\n\n; verify();// Function call to verify } else { exit; }// Since form_post is set, it proceeds to verify. Strangley enough, all the values appear in this if block. function verify() { echo Verify called. Values are...br\n Title: $titlebr\n Author: $authorbr\n Lead Actors: $actorsbr\n Poster: $posterbr\n Summ.: $summerybrbr\n\n Rev.: $reviewbrbr\n\n; } In the function verify no values appear, just: Title: Author: Lead Actors: Poster: Summ.: Rev.: Although -- as the comment said -- the if block shows all the values just fine. What could possibly be wrong? The solution to my last problem was to get rid of any functions. However, that results in highly messy code! There has got to be a way of having values passed to a function. Thanks for any help/suggestions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: combining headers with includes
Isn't working because when you include the file it complains that it can't send headers? Specially because there's an output on line X of the included file? Like anything outside ?php ? and/or echo, print, etc...? Well, you could try to make a smaller version of the included file that doesn't output anything to the browser. -- 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 Ian Wayne [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm trying to force the browser to download a movie rather than open it up and play it. Yesterday, Miguel kindly put me onto headers as being the way to do this. Problem is I have an include at the top of the page and that won't let me add in the necessary headers. The PHP manual says to use buffering as the way around this: ob_start(); and ob_end_clean(); Should these buffer commands go around the include statement? When I do that the page doesn't load at all, so I'm guessing that there must be another way, but what that way is I have no idea. Does anyone??? Thanks, Ian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: strlen() gives a wrong count
Once I say \n as strlen() = 2, if I remember correctly. Definitively not 1. Any whitespaces, tabs, newline, or similar inside? strlen() count them different. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Gil Disatnik [EMAIL PROTECTED] wrote in message 5.1.0.14.2.20020319220006.0148e9a0@servus">news:5.1.0.14.2.20020319220006.0148e9a0@servus... Hello there, I have a 98 characters string (including spaces), wc -c says it's 98 characters and a file containing this string is 98 bytes as well. For some reason - strlen() says it's more... it says it's a 104 characters strings, when I removed the spaces (using sed on the shell and using str_replace on php) - wc said it's 83 characters and strlen() said it's 89... How could that be? is there another way to get the exact number of characters in a string? Thanks. Regards Gil Disatnik UNIX system/security administrator. GibsonLP@EFnet _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ Windows NT has detected mouse movement, you MUST restart your computer before the new settings will take effect, [ OK ] Windows is a 32 bit patch to a 16 bit GUI based on a 8 bit operating system, written for a 4 bit processor by a 2 bit company which can not stand 1 bit of competition. -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [NEWMAN] make an if or else if statement from mysql.
Select before to see if exists: if (db_num_rows() 0) { // Update view where ip = visitor_ip } else { // Normal insert } -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Philip J. Newman [EMAIL PROTECTED] wrote in message 003401c1cf85$1afe54c0$0401a8c0@philip">news:003401c1cf85$1afe54c0$0401a8c0@philip... I have a log of IP numbers that come to WEBSITE A $sql = INSERT INTO `access` (`accessID`, `accessIP`, `accessDNS`, `accessTIME`, `accessUPDATE`, `accessVIEW`) VALUES ('', '$proxy_ip', '$proxy_dns', '$add_date', NOW(NULL), '0'); This has worked well, how ever when someone comes back with the same accessIP then I would like then accessVIEW aadds a +1 to the value. I would like help to create this .. if (!$remote_addr) - if the ip that they are using is the same as one in the table then update the record and use the accessID for that record. else if there isn't that $remote_addr in the table then it is added. I have yet to start on the code, so would some direction. 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
Re: [PHP] Re: [NEWMAN] make an if or else if statement from mysql.
if (db_num_rows() 0) {= WHERE DOSE THIS VERABLE COME FROM? This is just a count of the returned rows you have to make. First, do something like this: SELECT ip FROM table WHERE ip = visitor_ip; If it returns 0 rows, it means you don't have the ip and need to store, otherwise just update the view. db_num_rows was a generic way to call the function you will use. Since it's mysql, you can use mysql_num_rows. So: if (mysql_num_rows(mysql_query('the SELECT above')) { // -- 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: Undeclared Variables
error_reporting(); There's also an entry on php.ini to handle. It is safe although I personally do not recommend. Undeclared variables are a unexpected script behavior, it's good to know where your data is coming from and/or not trust it. For example a GET paramenter might override the value you were expecting. -- 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 Mark Williams [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I am using php 4.1.2 and I have 2 questions. : 1) How do I compile PHP not to depend on declared variables? 2) Assuming the above is possible, is this safe to do? Regards, Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Populating Dropdown with MYSQL data
select name=somename ?php $sql = SELECT id, name FROM table; $res = mysql_query($sql); while (list($id, $name) = mysql_fetch_array($res)) { echo option value=\$id\$name/option; } ? /select -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Jeff Dale [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I want to have a dropdown list populated with data from my MySql server. Any examples or websites that could help is appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help - Variables
if (isset($var_name)) { echo 'Isset!'; } ? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Budinschi Cosmin [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Could smbdy please help me I have a variable with the name $name(=the_name_of_the_variable) and I want to know if $the_name_of_the_variable is set. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can Event Handlers Trigger PHP Code?
No, because 'activation' of php is done by the server. PHP is a server side language. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Dr. Shim [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... My question is can event handlers on form objects trigger PHP code? input type=submit name=submit value=Submit Form onclick='PHP CODE HERE' Or even an onsubmit event handler on forms? If something like this is possible, could any of you tell me how? I've tried, and tried. I've used PHP tags inside the event handler input type=submit name=submit value=Submit Form onclick='? PHP CODE HERE ?' But the result is that the event handler is blank input type=submit name=submit value=Submit Form onclick='' since the interpreter hides any PHP code. Thus nothing happens on the event. Any help is appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Online Feedback and Application
Whetever you prefer. You may mail the form to you, or store in a database/file for retrival. Me? I would store on a database and make a page where I can see the feedbacks. I got so many emails daily that more would not be welcome. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.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]... I would like to make a little online feedback and application form. I was trying to decide if I should use the mailto action of the form or if there's some better way that I can do it in PHP. Is there a way I could just write it to a file or something in PHP or is there a more typical and better way to pull this off? Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: download 32000 images another server server
You could try to compress the images using php or telnet, or do it in batchs from 5000 files. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Random Selecting from mySQL
You could store the results in a session var to carry along the pages. Then on the second just retrieve them. Or maybe a second table with this info. Give each search an ID and store the results there. It would be easy to implement: INSERT INTO table ('',field) SELECT field FROM table ORDER BY rand() The first '' is for the autoincrement that will be used as your search id. -- 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 Georgie Casey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I know how to use the ORDER BY rand() command on the end of queries to randomize selection, but that's no good when you want to only display 10 results per page. The next page the user chooses, randomizes again and could show duplicate fields and not at all show other fields. Does anyone know a way round this? -- Regards, Georgie Casey [EMAIL PROTECTED] *** http://www.filmfind.tv Ireland's Online Film Production Directory *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: registering $_REQUEST variables as session variables.
$_SESSION['from_form'] = $_REQUEST; -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Zara E Gonzalez [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hullo, I was just wondering if anyone knew an easy way to register all $_REQUEST variables as session variables. Or if there's not any easy way to do that, if there is an easier way than doing it this way for each variable: $a = $_REQUEST['a']; session_register(a); $b = $_REQUEST['b']; session_register(b); etc I have a bunch of form variables that I need to set as session variables, but I'm not sure if there is an easy way to do so or not. I tried: session_register($_REQUEST['a']); but that didn't seem to work... any help is appreciated, Zara -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: registering $_REQUEST variables as session variables.
It would register a session variable name 'from_form' equal to $_REQUEST; The name 'from_form' was just an example, you need to change it according to your needs, if you wish. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Zara E Gonzalez [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... So because I'm a little dense, would that register the whole $_REQUEST array as a session variable? Or just 'from_form' ? Thanks, Zara -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php, text file, and mysql
If you are not going to save, I wouldn't call it a file :-) Just store the contents in a string and insert in a TEXT (etc) field. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Gregory Hernandez [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... hello everyone. i'm wondering if i can do the following: FIRST, using php, can i create/generate a text file on-the-fly (not saved to a server) THEN, insert the actual text file (and not its contents) into a mysql database. many thanks in advance, gregory hernandez [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Deleting a Record
First of all, make a copy of your database to test things. Never test code on production enviroment. Then, the delete syntax most of the time is: DELETE FROM table_name WHERE column = 'value'; Let's see: ?php $table = 'table_name'; $value = '15'; $sql = DELETE FROM $table WHERE field_1 = '$value'; mysql_query($sql) or exit(mysql_error()); ? There isn't a space between field and 1, at least I don't think SQL compliant databases let you put spaces on table and column names. $value probaly should be between single quotes, Mysql requires it for strings or values that are compared to a string type-column (varchar, text, etc...). Even sometimes for numeric columns, so, doesn't hurt to leave it unless it doesn't work ;-) If $table is not recognized, try: $sql = 'DELETE FROM ' . $table . WHERE field_1 = '$value'; If you just want to delete one record, it's a good idea to put a LIMIT 1 at the end. Hope it helps! -- 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 Chuck Pup Payne [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... Hi, I a seting up a php page that will let me delete a record from my mysql database, but I want it be able to match to fields before it will let a user delete that record. I know the basic sql command is DELETE FROM $table WHERE field 1 = $value But I don't know how to write the state for a second field. Can some one tell, but one field seem to give too much choose and would make it to easy to delete the wrong record. | Chuck Payne | | Magi Design and Support | | [EMAIL PROTECTED] | BeOS, Macintosh 68K, Classic, and OS X, Linux Support. Web Design you can afford. Never be bullied into silence. Never allow yourself to be made a victim. Accept no one's definition of your life; define yourself.- Harvey Fierstein -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Reading A file
If it's a file ending in .txt, you don't need PHP at all to make visual on the web, most browsers will just display it on the screen. Just link to it. But, if you want to echo it inside html, do: ?php $filename = 'path/to/file.txt'; $fd = fopen($filename,'r'); // might be 'rb', check manual page for fopen(); ? From here, you might go with readfile(); or file(), that will display the pointer's content (on this case, $fd). It might be necessary to change newlines for br, though. (nl2br(); or similar) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Sven Jacobs [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hey I have a TEXT file that I want to make visual via the web using php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: problems with replacing line breaks
Have you tried nl2br()? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Tom Kincaid [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; I'm trying to replace line breaks with html code and am having problems. For single lines preg_replace(/\n/,br,$text) or ereg_replace(\n,br,$text) adds the br but doesn't remove the line break. While preg_replace(/\n\n/,p,$text) doesn't find any double line breaks, even though they're there. Why doesn't this work? _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: posting data with curl
Submit the data to the action= url of the form, not to the form's page. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Wm [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; is there a way using curl or another way to post data to a script, but then to actually be tranferred to that page? (of course i mean without a submit buttonan auto post sort of thing.). using curl the script seems to wait for return data and doesn't give control to the url that the data was passed to. i know this is possible using the submit() function with javascript, but that won't work for this situation. any ideas? is there something in curl that i'm missing that will do this? i tried followlocation and it didn't seem to work? thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: how to: variable = php parsed file include
Find on phorm.php where you want to put your nav bar, and use: include('file_name.php'); -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Brian Petro [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; I've got a site that I've used php to include the navigation bar as a separate file. Within that nav-bar is a small php application. I have no problem including the php nav-bar file and it gets parsed by php and the application works. The problem is that I also want to use the same file include for the navigation in a dynamic thank you page that is generated by a php-based form processor. I'm using phorm.com's php form processor which I really like. The dynamic thank you page that it generates is actually a hard coded html page which phorm.php parses to replace form variables. I think my best way to do what I want is to have the script grab the nav-bar file, parse it through php, then take the string results and set a variable equal to that string. That way I can still use the script's built in parsing that replaces form variables in the hard coded thank you page. Does anyone know the syntax to do this? I understand the concept, but I'm way over my head. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: intranet security
I've done it :-) But be careful. There are dozens of way to implement this. My way is simple, but makes use of too many sql queries I believe. Could have stored everything in one line and grab it at user's login, but anyway My current way seems more logical to follow and update. I have created these 'groups of power', where you can add/remove users. Since an user can be part of more than one group, I store in a session array these groups ids. In a page where it's necessary to verify if the user (actually, the groups he's attached to) can perform certain actions, there's a little check like this: $var = ''; foreach ($_SESSION['user']['group_ids'] as $value) { $var .= OR group_id = '$value' ; } And a Mysql query: // 'groups' is a table with a collumn for every section of the site. $sql = SELECT section_power FROM groups WHERE id = 0 . $var . AND active = 1; $res = mysql_query($sql); while (list($section_power) = mysql_fetch_array($res)) { // using parse_str() since the data is stored om Mysql as: // r=1w=1d=0m=0 parse_str($section_power); // More on discover_power() below discover_powers($r,$w,$d,$m); } function discover_powers($r, $w, $d, $m) { // If there's no current power defined: if (!isset($_SESSION['user']['powers']['section']['w'])) { // User's power the same as the var; $_SESSION['user']['powers']['section']['w'] = $w; } else { // Else, in the while loop above, he's assigned to one group with power = 0 // and another one with power = 1, let the user get 1 if ($w $_SESSION['user']['powers']['section']['w']) { $_SESSION['user']['powers']['section']['w'] = $w; } } Well, pretty much is like this. I am close to redesign the whole thing because of the many SQL queries, the while loop calling two functions for every group the user is attached, and because it's plain a 'not-elegant' solution. Feel free to steal any ideas :-D -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] apostrphe's entered into MySQL database
Why isn't addslashes() working? You addslashes then you stripslashes() :-) Anyway, how about mysql_escape_string()? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Did everybody see the security warning at php.net?
Yes :-) http://www1.dshield.org/pipermail/vuln/2002-February/07.html http://developers.slashdot.org/article.pl?sid=02/02/27/1845238mode=threadt id=169 http://security.e-matters.de/advisories/012002.html http://www.newsbytes.com/news/02/174818.html Doesn't affect Windows, right? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Robert V. Zwink [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... http://www.php.net/ [27-Feb-2002] Due to a security issue found in all versions of PHP (including 3.x and 4.x), a new version of PHP has been released. Details about the security issue are available here. All users of PHP are strongly encouraged to either upgrade to PHP 4.1.2, or install the patch (available for PHP 3.0.18, 4.0.6 and 4.1.0/4.1.1). http://security.e-matters.de/advisories/012002.html -- 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: 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: 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 ?php so 99% of the times I escape with ?. Btw, you should start with ?php and not ?. Your input is missing the /, newer versions of HTML (or XHTML) recommend to finish tags that explicitily don't have a finishing term, with /. So it's: input type=text name=data / 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: HTMLBODY ? if ($submitdata) { dosomething; exit; } echo form name=\form\ action=\$PHP_SELF?\\n; echo input type=\text\ name=\data\\n; echo input type=\submit\ name=\submitdata\ value=\ Submit \\n; echo /form\n/body\n/html; ? -- 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 br, for html documents. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 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: ?php 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 ctrlaltdel and alttab
shiftf4 or altf4? Anyway, you could try to block with Javascript the alt key, which is common among all your options (or alt and shift). There's a key map on Javascript that references each keyborad key with a variable. Just do something like onKeyPress('var') = ''. I don't remember the 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 ctrlaltdel , alttab and shiftf4? 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
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: ?php if ($myrow = mysql_fetch_array($varetabell) AND $myro = mysql_fetch_array($varetab)) { echo TABLE border=\0\ width=\450\\n; echo tr\n; ? IMHO would be better: ?php if ($myrow = mysql_fetch_array($varetabell) AND $myro = mysql_fetch_array($varetab)) { ? TABLE border=0 width=450 tr td width=300 colspan=2bfont ?php } ? 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: 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] 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: 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
?php $array = range('a','z'); ? As usual your mileage may vary but it worked here :-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Mike Eheler [EMAIL 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]