Re: [PHP] ending a session
Raphael Hamzagic wrote: Thanks, But, if the client don't accept cookies? And if the user open a new browser window with the same url, the new window will use the same opened session. If the user opens a new window, without closing the old one first, then it will use the same session. If the client don't accept cookies, you'll have to turn transparant_session on. The problem with that is, that the user will not(probably, I'm not sure about this) get a new session, because the server doesn't know that the browser window is actually closed, like Rasmus told you. One reasen the user don't accept cookies, can be the following: http://www.w3.org/P3P/ Some users/browsers/company only accept cookies from websites which have a P3P statement. Other users just don't accept cookies. You'll have to live with that, use transparant_sessions and accept the negative sides of that (if it has any). HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ending a session
Victor wrote: Why not unregistered the session variables first, destroy the session second and redirect the user with a header location to a plain html page that includes a one line JavaScript in the body tag like onload+thiswindow cloase or something like that, and a message that please closes this window for complete logout. That's what I do and it works, in mozilla the script closes the window, in i.e. it asks that the user verify if they want to close the window, if they say no, then the user sees the message that please close this window to logout and that would pretty much take care of everything as far as I know. So, you first destroy the session, and then open a popup window? Why? If you destroyed the session, the user is already logged-out. Or do you destroy the session also in a popup window? In that case you have another two usergroups which can be a pain-in-the-ass: a) users that don't have JavaScript activated b) users (like me) that have a Popup killer Maybe, with all these solutions together, we can create the perfect logout script ;-)) Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Domxml: coping with UTF-16
Hello, You can try Krysalis to solve your problems. We have fully implemented UTF-8 support in both XML generation and XSL transformation, using a CDATA passthrough technique. http://www.interakt.ro/products/Krysalis/ As we have developed the site of the Romanian Ministry of ITC using Krysalis, we were stuck in a similar problem (both pasting from word and non ISO characters). The problems were fully resolved only after we have used the MB extension with a full UTF-8 XML/XSL pipeline. Unfortunately, I don't know if the current released version 1.1.2 has all the internationalization features activated, but the 2.0 Lite version (due for release at the beginning of November) will surelly support it. Alexandru Hi - I've built a web-based XML editor using PHP, so that clients can edit the sites themselves. The site HTML is generated dynamically via Sablotron. The problem is the users are copying-and-pasting from MS Word, and putting things like smart quotes and greek characters (one site is about maths) into the input boxes. This causes PHP to freak when it's trying to store the new content into the XML, and even if PHP survives, Sablotron breaks. I gather I need to set the XML document, XSL file, and stylesheet output to be UTF-16, instead of UTF-8. I can't see anything in the domxml functions to set encoding, though. Anyone got any ideas? Thanks, Gwyn. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Undefined index, Undefined variable, Undefined constant....
I'm having trouble with the newest version of PHP (4.2.2). For example in a page I'm using the following code: if ($_GET['action'] == logout) { //do something } But I'm getting an error message that says: ...log_message reports: PHP Notice: Undefined index: action in Ealier (other versions of PHP) I have succesfully used the above code, but do I now have to rewrite the code like this: if (isset($_GET['action']) AND $_GET['action'] == logout) { //do something } Or am I totally wrong? This was just one example when I'm getting the message Undefined index or Undefined variable etc. A lot of code which has previously worked is now giving me loads of headache since I have to rewrite everything. Please, I need some help. my email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] question
Hi, Can you help me? I want to send the button name to the another page when that button is pushed...Is it possible by using type=hidden or I need to use another way ...?? thanks alot meltem demirkus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] question
a form with two buttons: --- form action=script.php method=post input type=submit name=button value=option 1 / input type=submit name=button value=option 2 / /form --- script.php --- if($_POST['button'] == option 1) { echo option 1 was clicked; } elseif($_POST['button'] == option 2) { echo option 2 was clicked; } --- I think there's an issue with what happens if they hit enter (which value get submitted? option1 or option2? But you should be able to do some testing pretty quick on that, and choose the order of the buttons. Everything above is not tested of course. HTH Justin on 06/09/02 5:30 PM, Meltem Demirkus ([EMAIL PROTECTED]) wrote: Hi, Can you help me? I want to send the button name to the another page when that button is pushed...Is it possible by using type=hidden or I need to use another way ...?? thanks alot meltem demirkus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Undefined index, Undefined variable, Undefined constant....
Jens Winberg wrote: I'm having trouble with the newest version of PHP (4.2.2). For example in a page I'm using the following code: if ($_GET['action'] == logout) { //do something } But I'm getting an error message that says: ...log_message reports: PHP Notice: Undefined index: action in Ealier (other versions of PHP) I have succesfully used the above code, but do I now have to rewrite the code like this: if (isset($_GET['action']) AND $_GET['action'] == logout) { //do something } Or am I totally wrong? This was just one example when I'm getting the message Undefined index or Undefined variable etc. A lot of code which has previously worked is now giving me loads of headache since I have to rewrite everything. Heh, that can be solved by setting the error_reporting in the php.ini to E_ALL ~E_NOTICE They can also be disabled by putting the line error_reporting( E_ALL ~E_NOTICE ) at the first (second, after the ?php) line in your code. HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] noooob! = php logging into apache format?
im looking for a program which will take what is avaliable in the ENV variables and create a log file in the apache log file format. does anyone know of any existing scripts? what im trying to do is, run a log file analysis program for a website, but i have no logs from the apache server - i have to create my own. please help =D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fsockopen proxy?
im unable to access the web without first authenticating with the proxy. how can i still use fsockopen and authenticate myself with php? cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] register_globals = Off
Hi there In my shop a had this code to add a product to the shoppingcart: session_start(); session_register(cart); if($action == addtocart) { $cart[] = $id,$amount; } To view the cart i had to explode the session_variable $cart and get more data from the database. session_start(); foreach($cart as $value) { $value = list($id, $amount) = explode(,, $value); echo $id : $amount\n; } This workt perfect bevor i hat to reinstall my Computer. Now i have php 4.2.2 and every time i want to add a product to the cart it overwrites my session_variable. So now i have only the newest variable in the session_variable. I've tried it with $_REQUEST, $_SESSION, import_request_variables() but none of them gives me my array back. Can you help me ?
[PHP] cant find the wrong?
Hi, I am using this on a page to move 'new_id' to another page: input type=hidden name id value=? echo $new_id ? and onthe other page I qm tring to get the data like this: $id= $_POST['id'] ; even I tried echo $new_id; (directly use the data) but it is not working..WHY? thanks meltem demirkus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cant find the wrong?
you're missing an equals sign. try this: input type=hidden name=id value=? echo $new_id ? dave -Original Message- From: Meltem Demirkus [mailto:[EMAIL PROTECTED]] Sent: Friday, September 06, 2002 1:42 AM To: [EMAIL PROTECTED] Subject: [PHP] cant find the wrong? Hi, I am using this on a page to move 'new_id' to another page: input type=hidden name id value=? echo $new_id ? and onthe other page I qm tring to get the data like this: $id= $_POST['id'] ; even I tried echo $new_id; (directly use the data) but it is not working..WHY? thanks meltem demirkus -- 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
Fw: [PHP] cant find the wrong?
I am correcting I used echo $id; but did not work thanks. meltem - Original Message - From: Meltem Demirkus [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 06, 2002 11:42 AM Subject: [PHP] cant find the wrong? Hi, I am using this on a page to move 'new_id' to another page: input type=hidden name id value=? echo $new_id ? and onthe other page I qm tring to get the data like this: $id= $_POST['id'] ; even I tried echo $new_id; (directly use the data) but it is not working..WHY? thanks meltem demirkus -- 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: Array Javascript
if you have an array in javascript: array1 = [1,2,3,4,5,6,7,8,'test']; etc... you can join it in JavaScript to make it a one string as: array1 = array1.join('|'); then split in PHP to make it back an array: ? $array1 = explode('|', $array1); ? good luck, Kale [EMAIL PROTECTED] wrote in message 002c01c254cc$fe8eace0$7800a8c0@leonard">news:002c01c254cc$fe8eace0$7800a8c0@leonard... Hy, I have an array make with a javascript. How can I read values with PHP from it? Kale. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] question about Location
Is there anyway to direct my page to another after the php and output process work on the page? thanks meltem demirkus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Including files and functions
Hello I have A LOT of files that are already made, but does now Want to make a printerfriendly version of every file, but Ran into some problems How can i solve this without have to change every READILE.HTM files ?? FILE 'DEFAULT.HTM' if (eregi (PRINT.HTM, $PHP_SELF)) { exit; } HERE IT IS TEXT if (function_exists('write')) { call_user_func ('write'); } AND HERE THERE IS TEXT FILE 'READFILE.HTM' if(!isset($mainfile)) { include(DEFAULT.HTM); } function innhold() { THE TEXT HERE MORE TEXT A LINK TO PRINT.HTM GOES HERE } FILE 'PRINT.HTM' $print = $HTTP_REFERER; ... HERE GOES CODES FOR BRAKING THE $print READY FOR INCLUDE include $print; if (function_exists('write')) { call_user_func ('write'); } Regards Bård Tommy Nilsen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hardware Address
exec(arp $_SERVER[REMOTE_ADDR], $output); $output[0] should be something like ? (192.168.1.37) at 00:E0:4C:00:30:2D [ether] on eth0 Chris Cook wrote: Hello all, I am working on a LAN application and am interested in obtaining the user's network card address to limit usage of the program. Is there a way to do this in PHP? I am on a network that uses DHCP so using the IP address probably wont work and I am also worried about IP spoofing. Thanks for any help you can provide, Chris _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] precision using pow()
Hi, Split the calculation up an use echo to find the problem. David Rice wrote: Hi: I am attempting to calculate a mortgage payment using the following code. ?PHP $P = 10;// principal outstanding $I = 4.5;// annual interest rate percentage $N = 20;// number of years // The formula that I am using //(P*(((1+i/200)^(1/6)-1))/(1-(((1+i/200)^(1/6)))^-(n*12))) $Pmt = $P*((pow(1+($I/200),(1/6))-1)/(1-pow(pow((1+$I/200),(1/6)),-($N*12; echo $Pmt; ? which produces: 630.40515566726 What I am looking for is 632.65 (rounded to 2 places). (I am not looking for a rounding mechanism, just a more accurate result) The manual states that the pow function attempts to return an Integer. Is this the source of the inaccurate result? The manual also says to look at exp but appears to be missing some sort of usage example. I have no idea how that works. I tried a few things with no success. I also came across a mention of bcpow() but am unable to use this in the build that I am using. So is it some boneheaded coding error on my part or am I asking for too much of pow()? Thanks David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How do I keep a page from caching in I.E
4.09.2002, 17:48, Victor V. Evtushenko wrote: Donpro wrote: Hi, Using I.E. 5.5. I can't seem to keep a page from caching. When I click on Have you read HOWTO: Prevent Caching in Internet Explorer? http://support.microsoft.com/default.aspx?scid=kb;EN-US;q234067 According to the description I inserted header('Expires: -1'); It is fine if it is Internet Explorer. But e.g. Opera ignore the header. After BACK it displays old content. I even switched off all cache options in preferences but it does not help. the browser BACK button, I get the cached page so I have to click on Refresh to get the actual page content. I've placed the following at the top of the HTML file but it doesn't seem to do anything. Any help would be appreciated. Krzysztof Dziekiewicz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] question about Location
I mean I made a page with php and other stuff..And there is form .When I click on okbutton php is dpoing what it should . But after want the page to come to another link.I asked that before and they told me that .. there must be no uotput but I am using ?...? which means output.. so I dont know what to do.. meltem - Original Message - From: Brad Bonkoski [EMAIL PROTECTED] To: Meltem Demirkus [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:36 PM Subject: Re: [PHP] question about Location Not quite sure what you are getting at here? A hyper link would direct the user to another page :-) If you mean after a timeout/auto-magically perhaps you can try meta refresh: http://www.htmlhelp.com/reference/html40/head/meta.html HTH -Brad Meltem Demirkus wrote: Is there anyway to direct my page to another after the php and output process work on the page? thanks meltem demirkus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] question about Location
? ? doesn't mean output unless you use echo or print or whatever to output from there anything. Just use header(Location: yournewpage.php); at the end. Meltem Demirkus wrote: I mean I made a page with php and other stuff..And there is form .When I click on okbutton php is dpoing what it should . But after want the page to come to another link.I asked that before and they told me that .. there must be no uotput but I am using ?...? which means output.. so I dont know what to do.. meltem - Original Message - From: Brad Bonkoski [EMAIL PROTECTED] To: Meltem Demirkus [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:36 PM Subject: Re: [PHP] question about Location Not quite sure what you are getting at here? A hyper link would direct the user to another page :-) If you mean after a timeout/auto-magically perhaps you can try meta refresh: http://www.htmlhelp.com/reference/html40/head/meta.html HTH -Brad Meltem Demirkus wrote: Is there anyway to direct my page to another after the php and output process work on the page? thanks meltem demirkus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTTP_SERVER_VARS not working. Please help
I tried to use $HTTP_SERVER_VARS['HTTP_HOST'] but the result is null. Is there an option so I can turn it on? Please help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTTP_SERVER_VARS not working. Please help
Cirstoiu Aurel Sorin wrote: I tried to use $HTTP_SERVER_VARS['HTTP_HOST'] but the result is null. Is there an option so I can turn it on? If PHP 4.1.0: try $_SERVER['HTTP_HOST'] instead. You can also set register_globals = On in the php.ini file (not recommended!) HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTTP_SERVER_VARS not working. Please help
I also tried $_HTTP['HTTP_HOST']. Not working. The host has php 4.1.2 version -- Cirstoiu Aurel Sorin InterAKT Support http://www.interakt.ro Erwin [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Cirstoiu Aurel Sorin wrote: I tried to use $HTTP_SERVER_VARS['HTTP_HOST'] but the result is null. Is there an option so I can turn it on? If PHP 4.1.0: try $_SERVER['HTTP_HOST'] instead. You can also set register_globals = On in the php.ini file (not recommended!) HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] question about Location
I tried , but it is giving this error: Warning: Cannot add header information - headers already sent by (output started at C:\FoxServ\www\debugger\project_module\project_update_.php:2) in C:\FoxServ\www\debugger\project_module\project_update_.php on line 37 the line 2 is ? include start_html.php ? and start_html.php includes: ? include(defaults.php) ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2 Final//EN HTML HEAD TITLE ? echo $page_title ?/TITLE META http-equiv=Content-Type content=text/html; charset=windows-1254 /HEAD BODY and line 37 is the header I wrote ? header(Location: yournewpage.php); ? - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:55 PM Subject: Re: [PHP] question about Location ? ? doesn't mean output unless you use echo or print or whatever to output from there anything. Just use header(Location: yournewpage.php); at the end. Meltem Demirkus wrote: I mean I made a page with php and other stuff..And there is form .When I click on okbutton php is dpoing what it should . But after want the page to come to another link.I asked that before and they told me that .. there must be no uotput but I am using ?...? which means output.. so I dont know what to do.. meltem - Original Message - From: Brad Bonkoski [EMAIL PROTECTED] To: Meltem Demirkus [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:36 PM Subject: Re: [PHP] question about Location Not quite sure what you are getting at here? A hyper link would direct the user to another page :-) If you mean after a timeout/auto-magically perhaps you can try meta refresh: http://www.htmlhelp.com/reference/html40/head/meta.html HTH -Brad Meltem Demirkus wrote: Is there anyway to direct my page to another after the php and output process work on the page? thanks meltem demirkus -- 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
Re: [PHP] Re: HTTP_SERVER_VARS not working. Please help
that's: $_SEVER['HTTP_HOST'] Cirstoiu Aurel Sorin wrote: I also tried $_HTTP['HTTP_HOST']. Not working. The host has php 4.1.2 version -- Cirstoiu Aurel Sorin InterAKT Support http://www.interakt.ro Erwin [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Cirstoiu Aurel Sorin wrote: I tried to use $HTTP_SERVER_VARS['HTTP_HOST'] but the result is null. Is there an option so I can turn it on? If PHP 4.1.0: try $_SERVER['HTTP_HOST'] instead. You can also set register_globals = On in the php.ini file (not recommended!) HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: HTTP_SERVER_VARS not working. Please help
Yes, I ment $_SEVER['HTTP_HOST'] but I wrote wrong. Still nothing. What is the problem?? This should work but is not. -- Cirstoiu Aurel Sorin InterAKT Support http://www.interakt.ro Brad Bonkoski [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... that's: $_SEVER['HTTP_HOST'] Cirstoiu Aurel Sorin wrote: I also tried $_HTTP['HTTP_HOST']. Not working. The host has php 4.1.2 version -- Cirstoiu Aurel Sorin InterAKT Support http://www.interakt.ro Erwin [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Cirstoiu Aurel Sorin wrote: I tried to use $HTTP_SERVER_VARS['HTTP_HOST'] but the result is null. Is there an option so I can turn it on? If PHP 4.1.0: try $_SERVER['HTTP_HOST'] instead. You can also set register_globals = On in the php.ini file (not recommended!) HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: HTTP_SERVER_VARS not working. Please help
This is not the problem. I understand what you mean. Now you wrote wrong and I copy pasted. I tried with $_SERVER['HTTP_HOST'] . No effect. -- Cirstoiu Aurel Sorin InterAKT Support http://www.interakt.ro Cirstoiu Aurel Sorin [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Yes, I ment $_SEVER['HTTP_HOST'] but I wrote wrong. Still nothing. What is the problem?? This should work but is not. -- Cirstoiu Aurel Sorin InterAKT Support http://www.interakt.ro Brad Bonkoski [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... that's: $_SEVER['HTTP_HOST'] Cirstoiu Aurel Sorin wrote: I also tried $_HTTP['HTTP_HOST']. Not working. The host has php 4.1.2 version -- Cirstoiu Aurel Sorin InterAKT Support http://www.interakt.ro Erwin [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Cirstoiu Aurel Sorin wrote: I tried to use $HTTP_SERVER_VARS['HTTP_HOST'] but the result is null. Is there an option so I can turn it on? If PHP 4.1.0: try $_SERVER['HTTP_HOST'] instead. You can also set register_globals = On in the php.ini file (not recommended!) HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] question about Location
Are you needing to output anything to your users before the page is sent to this new page? If not, then simple answer, don't send output before redirecting. Brief example (coming from a submitted form) ?php extract($_POST); if ($action) { // something's been submitted. // Process all of the information. If there are no errors, then get outta here. header(location: /formcomplete.php); exit; } ? html !-- All of your form and other HTML here. -- /html -James Meltem Demirkus [EMAIL PROTECTED] wrote in message 03ef01c2558e$923180f0$5583@hiborya">news:03ef01c2558e$923180f0$5583@hiborya... I tried , but it is giving this error: Warning: Cannot add header information - headers already sent by (output started at C:\FoxServ\www\debugger\project_module\project_update_.php:2) in C:\FoxServ\www\debugger\project_module\project_update_.php on line 37 the line 2 is ? include start_html.php ? and start_html.php includes: ? include(defaults.php) ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2 Final//EN HTML HEAD TITLE ? echo $page_title ?/TITLE META http-equiv=Content-Type content=text/html; charset=windows-1254 /HEAD BODY and line 37 is the header I wrote ? header(Location: yournewpage.php); ? - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:55 PM Subject: Re: [PHP] question about Location ? ? doesn't mean output unless you use echo or print or whatever to output from there anything. Just use header(Location: yournewpage.php); at the end. Meltem Demirkus wrote: I mean I made a page with php and other stuff..And there is form .When I click on okbutton php is dpoing what it should . But after want the page to come to another link.I asked that before and they told me that .. there must be no uotput but I am using ?...? which means output.. so I dont know what to do.. meltem - Original Message - From: Brad Bonkoski [EMAIL PROTECTED] To: Meltem Demirkus [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:36 PM Subject: Re: [PHP] question about Location Not quite sure what you are getting at here? A hyper link would direct the user to another page :-) If you mean after a timeout/auto-magically perhaps you can try meta refresh: http://www.htmlhelp.com/reference/html40/head/meta.html HTH -Brad Meltem Demirkus wrote: Is there anyway to direct my page to another after the php and output process work on the page? thanks meltem demirkus -- 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
RE: [PHP] question about Location
see, if you output anything for the user, then you cannot use a header if your include files have echo/print statements or errors that are displayed then it is considered output. use JavaScript to redirect the page look up window.location=url in JavaScript reference embed that script in php. or else turn output buffering on. look up * http://www.zend.com/zend/art/buffering.php * http://www.phpbuilder.com/columns/argerich20010125.php3 (taken from php manual) -Naintara -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] t]On Behalf Of Meltem Demirkus Sent: Friday, September 06, 2002 3:47 PM To: [EMAIL PROTECTED] Subject: Fw: [PHP] question about Location I tried , but it is giving this error: Warning: Cannot add header information - headers already sent by (output started at C:\FoxServ\www\debugger\project_module\project_update_.php:2) in C:\FoxServ\www\debugger\project_module\project_update_.php on line 37 the line 2 is ? include start_html.php ? and start_html.php includes: ? include(defaults.php) ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2 Final//EN HTML HEAD TITLE ? echo $page_title ?/TITLE META http-equiv=Content-Type content=text/html; charset=windows-1254 /HEAD BODY and line 37 is the header I wrote ? header(Location: yournewpage.php); ? - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:55 PM Subject: Re: [PHP] question about Location ? ? doesn't mean output unless you use echo or print or whatever to output from there anything. Just use header(Location: yournewpage.php); at the end. Meltem Demirkus wrote: I mean I made a page with php and other stuff..And there is form .When I click on okbutton php is dpoing what it should . But after want the page to come to another link.I asked that before and they told me that .. there must be no uotput but I am using ?...? which means output.. so I dont know what to do.. meltem - Original Message - From: Brad Bonkoski [EMAIL PROTECTED] To: Meltem Demirkus [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:36 PM Subject: Re: [PHP] question about Location Not quite sure what you are getting at here? A hyper link would direct the user to another page :-) If you mean after a timeout/auto-magically perhaps you can try meta refresh: http://www.htmlhelp.com/reference/html40/head/meta.html HTH -Brad Meltem Demirkus wrote: Is there anyway to direct my page to another after the php and output process work on the page? thanks meltem demirkus -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fw: [PHP] question about Location
Put your code that takes care of the post before the line 2, output the header and exit. Like this ? if($_POST['submit']) { do what needs to be done header(Location: nextpage.php); exit; } include start_html.php Meltem Demirkus wrote: I tried , but it is giving this error: Warning: Cannot add header information - headers already sent by (output started at C:\FoxServ\www\debugger\project_module\project_update_.php:2) in C:\FoxServ\www\debugger\project_module\project_update_.php on line 37 the line 2 is ? include start_html.php ? and start_html.php includes: ? include(defaults.php) ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2 Final//EN HTML HEAD TITLE ? echo $page_title ?/TITLE META http-equiv=Content-Type content=text/html; charset=windows-1254 /HEAD BODY and line 37 is the header I wrote ? header(Location: yournewpage.php); ? - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:55 PM Subject: Re: [PHP] question about Location ? ? doesn't mean output unless you use echo or print or whatever to output from there anything. Just use header(Location: yournewpage.php); at the end. Meltem Demirkus wrote: I mean I made a page with php and other stuff..And there is form .When I click on okbutton php is dpoing what it should . But after want the page to come to another link.I asked that before and they told me that .. there must be no uotput but I am using ?...? which means output.. so I dont know what to do.. meltem - Original Message - From: Brad Bonkoski [EMAIL PROTECTED] To: Meltem Demirkus [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:36 PM Subject: Re: [PHP] question about Location Not quite sure what you are getting at here? A hyper link would direct the user to another page :-) If you mean after a timeout/auto-magically perhaps you can try meta refresh: http://www.htmlhelp.com/reference/html40/head/meta.html HTH -Brad Meltem Demirkus wrote: Is there anyway to direct my page to another after the php and output process work on the page? thanks meltem demirkus -- 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
Re: Fw: [PHP] question about Location
make sure there is no whitespace before first ? - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Friday, September 06, 2002 11:34 AM Subject: Re: Fw: [PHP] question about Location Put your code that takes care of the post before the line 2, output the header and exit. Like this ? if($_POST['submit']) { do what needs to be done header(Location: nextpage.php); exit; } include start_html.php Meltem Demirkus wrote: I tried , but it is giving this error: Warning: Cannot add header information - headers already sent by (output started at C:\FoxServ\www\debugger\project_module\project_update_.php:2) in C:\FoxServ\www\debugger\project_module\project_update_.php on line 37 the line 2 is ? include start_html.php ? and start_html.php includes: ? include(defaults.php) ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2 Final//EN HTML HEAD TITLE ? echo $page_title ?/TITLE META http-equiv=Content-Type content=text/html; charset=windows-1254 /HEAD BODY and line 37 is the header I wrote ? header(Location: yournewpage.php); ? - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:55 PM Subject: Re: [PHP] question about Location ? ? doesn't mean output unless you use echo or print or whatever to output from there anything. Just use header(Location: yournewpage.php); at the end. Meltem Demirkus wrote: I mean I made a page with php and other stuff..And there is form .When I click on okbutton php is dpoing what it should . But after want the page to come to another link.I asked that before and they told me that .. there must be no uotput but I am using ?...? which means output.. so I dont know what to do.. meltem - Original Message - From: Brad Bonkoski [EMAIL PROTECTED] To: Meltem Demirkus [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:36 PM Subject: Re: [PHP] question about Location Not quite sure what you are getting at here? A hyper link would direct the user to another page :-) If you mean after a timeout/auto-magically perhaps you can try meta refresh: http://www.htmlhelp.com/reference/html40/head/meta.html HTH -Brad Meltem Demirkus wrote: Is there anyway to direct my page to another after the php and output process work on the page? thanks meltem demirkus -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] question about Location
ok thans , I am trying meltem Meltem Demirkus wrote: I tried , but it is giving this error: Warning: Cannot add header information - headers already sent by (output started at C:\FoxServ\www\debugger\project_module\project_update_.php:2) in C:\FoxServ\www\debugger\project_module\project_update_.php on line 37 the line 2 is ? include start_html.php ? and start_html.php includes: ? include(defaults.php) ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2 Final//EN HTML HEAD TITLE ? echo $page_title ?/TITLE META http-equiv=Content-Type content=text/html; charset=windows-1254 /HEAD BODY and line 37 is the header I wrote ? header(Location: yournewpage.php); ? - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:55 PM Subject: Re: [PHP] question about Location ? ? doesn't mean output unless you use echo or print or whatever to output from there anything. Just use header(Location: yournewpage.php); at the end. Meltem Demirkus wrote: I mean I made a page with php and other stuff..And there is form .When I click on okbutton php is dpoing what it should . But after want the page to come to another link.I asked that before and they told me that .. there must be no uotput but I am using ?...? which means output.. so I dont know what to do.. meltem - Original Message - From: Brad Bonkoski [EMAIL PROTECTED] To: Meltem Demirkus [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, September 06, 2002 12:36 PM Subject: Re: [PHP] question about Location Not quite sure what you are getting at here? A hyper link would direct the user to another page :-) If you mean after a timeout/auto-magically perhaps you can try meta refresh: http://www.htmlhelp.com/reference/html40/head/meta.html HTH -Brad Meltem Demirkus wrote: Is there anyway to direct my page to another after the php and output process work on the page? thanks meltem demirkus -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Source code
How I show in IE source code of html page with php ? roman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cant find the wrong?
are u using the exact code (below, as given by u) input type=hidden name id value=? echo $new_id ? if yes, the 1st page has the problem (missing = ), replace with this input type=hidden name=id value=? echo $new_id ? name=id not name id -Naintara -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] t]On Behalf Of Meltem Demirkus Sent: Friday, September 06, 2002 2:16 PM To: [EMAIL PROTECTED] Subject: Fw: [PHP] cant find the wrong? I am correcting I used echo $id; but did not work thanks. meltem - Original Message - From: Meltem Demirkus [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 06, 2002 11:42 AM Subject: [PHP] cant find the wrong? Hi, I am using this on a page to move 'new_id' to another page: input type=hidden name id value=? echo $new_id ? and onthe other page I qm tring to get the data like this: $id= $_POST['id'] ; even I tried echo $new_id; (directly use the data) but it is not working..WHY? thanks meltem demirkus -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Source code
You can't. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Roman Duriancik [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] How I show in IE source code of html page with php ? roman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Source code
showsource.php: html body span style='border:dashed 2px red' ? $mem = join('', file('THEFILE.HTM')); $mem = htmlspecialchars($mem); echo $mem; ? /span Good luck, Roman Duriancik [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... How I show in IE source code of html page with php ? roman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] unix timestamp
Hi everybody, I am trying to create a unix timestamp which dates back a certain amount of days. Lets say I would like to have a unix timestamp from 7 days ago. what I tryed is just to subtract values since this are counted s since the start of the unix epoche, but this does not work in cases like the switch of months. Has anybody an idea how to do that? Thanx, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] unix timestamp
Hi Andy, I am trying to create a unix timestamp which dates back a certain amount of days. Lets say I would like to have a unix timestamp from 7 days ago. what I tryed is just to subtract values since this are counted s since the start of the unix epoche, but this does not work in cases like the switch of months. A quick and dirty way is to subtract 86400 from the current timestamp to push it back one day, so it would be (7*86400)=604800 for a week. This isn't the best method though - you should be able to do calculations within mktime(). If you post the code you tried we can have a look. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] refresh a php page
Hi, Is it possible to refresh a php page by a code?Or I should use meta or javascript?. thanks meltem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: refresh a php page
Meltem Demirkus [EMAIL PROTECTED] wrote in message 001b01c2559c$11d3af60$5583@hiborya">news:001b01c2559c$11d3af60$5583@hiborya... Hi, Is it possible to refresh a php page by a code?Or I should use meta or javascript?. thanks meltem Most of the responses I get when I ask Qs of messing with the browser is that php is not capable of this coz it is a Server Side tool. Hence my inclination would lead me to say this cannot be done (You'd have to use javascript most likely)... I maybe wrong though... Just responding wrt the responses that I got from the tons of posts that I have posted in the past... Spike... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Source code
add nl2br() to make it look pretty e.g span ? $mem = join('', file('index.htm')); $mem = htmlspecialchars($mem); $mem = nl2br($mem); echo $mem; ? /span - Original Message - From: Roman Duriancik [EMAIL PROTECTED] To: PHP-General [EMAIL PROTECTED] Sent: Friday, September 06, 2002 11:53 AM Subject: [PHP] Source code How I show in IE source code of html page with php ? roman -- 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: unix timestamp
You should use mktime() mktime (PHP 3, PHP 4 ) mktime -- Get UNIX timestamp for a date Description int mktime ( int hour, int minute, int second, int month, int day, int year [, int is_dst]) www.php.net/mktime -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Andy [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hi everybody, I am trying to create a unix timestamp which dates back a certain amount of days. Lets say I would like to have a unix timestamp from 7 days ago. what I tryed is just to subtract values since this are counted s since the start of the unix epoche, but this does not work in cases like the switch of months. Has anybody an idea how to do that? Thanx, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: refresh a php page
You can use header() : header(Refresh: time; URL:http://php.net); Or in javascript: A HREF=# onclick=document.location.reload();return(false)BRefresh/B/Abr (on click) Or in meta : META HTTP-EQUIV=REFRESH CONTENT=time -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Meltem Demirkus [EMAIL PROTECTED] a écrit dans le message de news: 001b01c2559c$11d3af60$[EMAIL PROTECTED] Hi, Is it possible to refresh a php page by a code?Or I should use meta or javascript?. thanks meltem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] defining vars within functions as global
On Fri, 06 Sep 2002 13:52:08 +1000, you wrote: Hi, I'd like to be able to define multiple variables within a function, and have it available outside the function from the point the function is called... How about this: ? function foo() { return array ( foo = aaa, bar = bbb ); } extract(foo()); echo $foo; echo $bar; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Low Cost PHP Hosting
Hi All, I have recently subscribed to the list and would like to thank everyone for their support and guidance in the use of the PHP scripting language. I am trying to find a low cost host for testing out PHP web applications on the Internet. I have a similar account set up with Brinkster for ASP and ASP.NET code but would like a similar environment for PHP. Any ideas? Thanks. Regards Phil. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Source code
I think it is also good to fetch $mem as: $fp = fopen('index.htm', 'r'); $mem = fread($fp, filesize('index.htm')); fclose($fp); that will keep index.htm formatted as is. Adrian Murphy [EMAIL PROTECTED] wrote in message 001b01c2559f$aa8f3c30$1a8f43d9@ADE2">news:001b01c2559f$aa8f3c30$1a8f43d9@ADE2... add nl2br() to make it look pretty e.g span ? $mem = join('', file('index.htm')); $mem = htmlspecialchars($mem); $mem = nl2br($mem); echo $mem; ? /span - Original Message - From: Roman Duriancik [EMAIL PROTECTED] To: PHP-General [EMAIL PROTECTED] Sent: Friday, September 06, 2002 11:53 AM Subject: [PHP] Source code How I show in IE source code of html page with php ? roman -- 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
Re: [PHP] Re: Hardware Address
To get the hardware address you need to dig down through the network layers. If you look at the OSI 7 network model (used on all systems), you will see that PHP really operates on layers 6 7. The hardware address (MAC Address) is down on layer 2, the data link layer. The layered model is designed to assure compatibility and ease of implementation. Meaning, each layer does what it is supposed to and doesn't care how the other layers accomplish their job. I highly doubt that PHP would be permitted to dig down into the network stack when it's not running as root. I'm not sure what you mean by universities and broadband isp do 'this'. If you are referring to limiting bandwidth, this should be, and usually is, done on the router level. ISP's want to limit use of their network bandwidth, not their server bandwidth. Limiting use of an application is normally done through a user login. Wouldn't you want to limit the user not a specific computer? Besides, it's easy enough to override the hardware address of a network card or even use a different one. Easier than IP spoofing. On Thursday, September 5, 2002, at 09:45 PM, Tyler Longren wrote: using exec() or system() will only be able to execute commands on the machine php is installed on. I sometimes wonder how universities and broadband isp's do this. I'd be interested in seeing how it works. Sorry, I'm not much help anymore. tyler On Fri, 6 Sep 2002 01:24:07 +0200 [EMAIL PROTECTED] wrote: Hi, The best way I think is to use exec() or system() to ask that to the system. May be someone knows something better too. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Chris Cook [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hello all, I am working on a LAN application and am interested in obtaining the user's network card address to limit usage of the program. Is there a way to do this in PHP? I am on a network that uses DHCP so using the IP address probably wont work and I am also worried about IP spoofing. Thanks for any help you can provide, Chris _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- 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 -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with inserting values into database through php
[snip] I´m quite a newbie in making php, but I managed to run the test you suggested, but nothin happened. This time it was propably the code I did: first I added the or die(Invalid query: $sql); part and ran the form, but everything happened just like when refreshing a page. Then I did this: $result = mysql_query($sql) or die(Invalid query: $sql); echo $sql; but the database was silentit just refreshed the page and cleared out the form. [/snip] 1. Here is a different method of error checking for queries; if the query is $query = SELECT foo FROM BAR ; if(!($result = mysql_query($query, $database_connection))){ print(MySQL reports the following error: . mysql_error() . \n); exit(); } 2. Check your web access and error logs for clues. 3. Does the user have permission to INSERT and/or UPDATE? If you set those on the database did you flush the grant tables? HTH! Jay In clinical trials for diabetes medications do they give sugar pills as placebos? * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] about whitespace
Hi, is there any function which removes white spaces inse a string? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] gettext issues
I am implementing gettext into a website, but for some reason, the pages keep swapping between the intended translated language (French), and the primary language (English). I'm using RedHat 7.3, with gettext-0.11.1-2 RPM. At the top of every page, I have this code: setlocale(LC_ALL, 'fr_FR'); bindtextdomain('messages', $_SERVER['DOCUMENT_ROOT'].'/locale'); textdomain('messages'); And on my testing page, I have gettext() calls surrounding any outputted text. Upon checking the returned result of setlocale, it is indeed 'fr_FR'. I have created a messages.po file (via xgettext -n *.php), and put in the translated text. I then created the messages.mo file (via msgfmt messages.po). These are both placed in the following directory: /home/web/website/locale/fr_FR/LC_MESSAGES Now, when I load up the web page, everything *should* be French. Sometimes it is. But sometimes it's English instead. It's a 50/50 thing. I've verified that the setlocale call is ALWAYS using fr_FR. Can anyone help me out? (And as an aside, can the gettext parameter span multiple lines, or must it be on one line?) -- Aaron Gould -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: about whitespace
str_replace() Meltem Demirkus [EMAIL PROTECTED] wrote in message 001201c255a4$6253ece0$5583@hiborya">news:001201c255a4$6253ece0$5583@hiborya... Hi, is there any function which removes white spaces inse a string? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
SV: [PHP] about whitespace
Take a look at str_replace function ... Bård Tommy -Opprinnelig melding- Fra: Meltem Demirkus [mailto:[EMAIL PROTECTED]] Sendt: 6. september 2002 14:53 Til: [EMAIL PROTECTED] Emne: [PHP] about whitespace Hi, is there any function which removes white spaces inse a string? thanks -- 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
RE: [PHP] Problem with inserting values into database through php
Just and FYI update, in case someone else has this problem... The problem was the example was using $PHP_SELF as the form action variable, of course it has been discussed on this list that in the newer versions of PHP, register_globals is turned off in php.ini, so $PHP_SELF had no real meaning, so no data was actually being passed. So, just an update to change it to: form action=?php echo $_SERVER['PHP_SELF']? method=post -Brad [snip] I´m quite a newbie in making php, but I managed to run the test you suggested, but nothin happened. This time it was propably the code I did: first I added the or die(Invalid query: $sql); part and ran the form, but everything happened just like when refreshing a page. Then I did this: $result = mysql_query($sql) or die(Invalid query: $sql); echo $sql; but the database was silentit just refreshed the page and cleared out the form. [/snip] 1. Here is a different method of error checking for queries; if the query is $query = SELECT foo FROM BAR ; if(!($result = mysql_query($query, $database_connection))){ print(MySQL reports the following error: . mysql_error() . \n); exit(); } 2. Check your web access and error logs for clues. 3. Does the user have permission to INSERT and/or UPDATE? If you set thos e on the database did you flush the grant tables? HTH! Jay In clinical trials for diabetes medications do they give sugar pills as placebos? * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- 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
RE: [PHP] Low Cost PHP Hosting
Philip, I've found UK Linux (http://www.uklinux.net) to offer a good service at low cost. They also offer 50% discount for charities. Michael Egan -Original Message- From: Philip Radford [mailto:[EMAIL PROTECTED]] Sent: 06 September 2002 05:47 To: [EMAIL PROTECTED] Subject: [PHP] Low Cost PHP Hosting Hi All, I have recently subscribed to the list and would like to thank everyone for their support and guidance in the use of the PHP scripting language. I am trying to find a low cost host for testing out PHP web applications on the Internet. I have a similar account set up with Brinkster for ASP and ASP.NET code but would like a similar environment for PHP. Any ideas? Thanks. Regards Phil. -- 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] Html in a string
Hello I have a string with the html source, but want to fetch only some Of the code ... I want to use alle the codes inside start-end .. Example: !-- start HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE // end -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] about whitespace
[snip] is there any function which removes white spaces inse a string? [/snip] eregi_replace(), there are others as well. http://www.php.net/manual/en/function.eregi-replace.php rtfm(); HTH!; Jay I bet I can stop gambling * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Html in a string
[snip] I have a string with the html source, but want to fetch only some Of the code ... I want to use alle the codes inside start-end .. Example: !-- start HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE // end -- [/snip] Have a look at the regex functions ... http://www.php.net/manual/en/ref.regex.php HTH! Jay HONK if you love peace quiet * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Including files and functions
[snip] I have A LOT of files that are already made, but does now Want to make a printerfriendly version of every file, but Ran into some problems How can i solve this without have to change every READILE.HTM files ?? [/snip] If I understand you have a look at CSS on http://www.w3c.org. HTH! Jay He who laughs last thinks slowest! * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] gmdate()
Isn't the gmdate() supposed to return the same value when run from two different timezones? I run it on GMT+2 system and EDT system, and I get 1 hour difference, please advise. Elias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Image resizing
I have been trying to figure out the best way to resize photo quality images to thumbnail size and have them come out looking good. I have read about the function http://www.php.net/manual/en/function.imagecreatetruecolor.php imagecreatetruecolor() and it looks like it may do this. However I do not have GD 2 installed which is required for this function to work. In the process of trying to figure out how to install GD v2 I came across the following page. http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.image.php On this page is says; Since PHP 4.3 there is a bundeled version of the GD lib. This bundeled version has some additional features like alpha blending and should be used in preference to the external library since it's codebase is better maintained and more stable. I thought the most recent version of php was 4.2.2? Anyway if there is a better way to resize images to create high quality thumbnails I would love to hear about it. I am on a redhat 7.3 server and not very familiar with linux. I would prefer not to have to take the time involved in learning how to install new packages right now, but realize this may be unavoidable. Thanks in advance for any help.
RE: [PHP] Low Cost PHP Hosting
Hi Phil, I am trying to find a low cost host for testing out PHP web applications on the Internet. http://34sp.com/ are pretty good, and at £15 a year (about US$20 I believe), they're certainly low cost :-) I'd stay away from http://zenithtech.com/ though, lots of people I know have had a very poor experience with them. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Low Cost PHP Hosting
Hey, 321go.biz no problems so far... hope that helped. Cheers. -Ryan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: unix timestamp
Hi everybody, here is the code which does unfortunatelly not work as I want. The goal is to produce a unix timestamp which is a date 7 days ago and one 14 days ago and so on. code: switch ($ts){ case 1: // today $timestamp = mktime (0,0,0,date(m) ,date(d),date(Y)); break; case 2: // yesterday $timestamp = mktime (0,0,0,date(m),date(d)-1, date(Y)); break; case 2: // last week $timestamp = mktime (0,0,0,date(m),date(d)-7, date(Y)); break; } Maybe someone can see the error? Thank you for any help on that. Andy [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... You should use mktime() mktime (PHP 3, PHP 4 ) mktime -- Get UNIX timestamp for a date Description int mktime ( int hour, int minute, int second, int month, int day, int year [, int is_dst]) www.php.net/mktime -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Andy [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hi everybody, I am trying to create a unix timestamp which dates back a certain amount of days. Lets say I would like to have a unix timestamp from 7 days ago. what I tryed is just to subtract values since this are counted s since the start of the unix epoche, but this does not work in cases like the switch of months. Has anybody an idea how to do that? Thanx, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Low Cost PHP Hosting
Michael Egan wrote: Philip, I've found UK Linux (http://www.uklinux.net) to offer a good service at low cost. They also offer 50% discount for charities. Phil, Yes, in the UK, UK Linux is good, I have an account. They do a free account too (just use the phone line for 1hour per month). There are differing grades for better services. Alternatively, this question comes up so often that it well worth looking in the archives or we will have everyone post their favourite again :-) HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Source code
I might be missing something, but Wouldn't this suffice? : http://www.php.net/manual/en/function.highlight-file.php Maintains formatting *and* colours things up nicely. -James Lallous [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I think it is also good to fetch $mem as: $fp = fopen('index.htm', 'r'); $mem = fread($fp, filesize('index.htm')); fclose($fp); that will keep index.htm formatted as is. Adrian Murphy [EMAIL PROTECTED] wrote in message 001b01c2559f$aa8f3c30$1a8f43d9@ADE2">news:001b01c2559f$aa8f3c30$1a8f43d9@ADE2... add nl2br() to make it look pretty e.g span ? $mem = join('', file('index.htm')); $mem = htmlspecialchars($mem); $mem = nl2br($mem); echo $mem; ? /span - Original Message - From: Roman Duriancik [EMAIL PROTECTED] To: PHP-General [EMAIL PROTECTED] Sent: Friday, September 06, 2002 11:53 AM Subject: [PHP] Source code How I show in IE source code of html page with php ? roman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Html in a string
$mem = ' !-- start HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE // end -- '; if (preg_match('/!--.+?--/is', $mem, $result)) { var_dump($result); } good luck, Bård tommy nilsen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello I have a string with the html source, but want to fetch only some Of the code ... I want to use alle the codes inside start-end .. Example: !-- start HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE HTML CODES HERE // end -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] wrong timestamp?
Hi there, this is a add on a post I did a few hours ago regarding timestamp. I was able to locate the error, but not to fix it. The code : $timestamp = date('YmdGis',(mktime (0,0,0,date(m) ,date(d)-1,date(Y) ) ) ); produces a string like this: 200209050 There is one 0 missing. Because of this my querry is not working, How come this timestamp is wrong? Thanx for any help, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: about whitespace
str_replace() works .. thanks meltem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: wrong timestamp?
I was able to locate the error, but not to fix it. The code : $timestamp = date('YmdGis',(mktime (0,0,0,date(m) ,date(d)-1,date(Y) ) ) ); produces a string like this: 200209050 There is one 0 missing. Because of this my querry is not working, How come this timestamp is wrong? It's not wrong...read the manual ;-)) Y = Year, 4 digits m = month, 2 digits d = day, 2 digits G = 24 hour, from 0 to 23 H = 24 hour, 2 digits i = minutes, 2 digits s = seconds, 2 digits You have to use YmdHis instead! HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] unix timestamp
Hi, You can just use : $output = strtotime(+1 day); $output = strtotime(-7 day); http://dk.php.net/manual/en/function.strtotime.php -Morten Skou -Original Message- From: andy [mailto:[EMAIL PROTECTED]] Sent: 6. september 2002 13:50 To: [EMAIL PROTECTED] Subject: [PHP] unix timestamp Hi everybody, I am trying to create a unix timestamp which dates back a certain amount of days. Lets say I would like to have a unix timestamp from 7 days ago. what I tryed is just to subtract values since this are counted s since the start of the unix epoche, but this does not work in cases like the switch of months. Has anybody an idea how to do that? Thanx, Andy -- 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
Re: [PHP] Re: HTTP_SERVER_VARS not working. Please help
Contents of the Host: header from the current request, if there is one. Does your browser send Host: ? If you use IP it doesn't Cirstoiu Aurel Sorin wrote: This is not the problem. I understand what you mean. Now you wrote wrong and I copy pasted. I tried with $_SERVER['HTTP_HOST'] . No effect. -- Cirstoiu Aurel Sorin InterAKT Support http://www.interakt.ro Cirstoiu Aurel Sorin [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Yes, I ment $_SEVER['HTTP_HOST'] but I wrote wrong. Still nothing. What is the problem?? This should work but is not. -- Cirstoiu Aurel Sorin InterAKT Support http://www.interakt.ro Brad Bonkoski [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... that's: $_SEVER['HTTP_HOST'] Cirstoiu Aurel Sorin wrote: I also tried $_HTTP['HTTP_HOST']. Not working. The host has php 4.1.2 version -- Cirstoiu Aurel Sorin InterAKT Support http://www.interakt.ro Erwin [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Cirstoiu Aurel Sorin wrote: I tried to use $HTTP_SERVER_VARS['HTTP_HOST'] but the result is null. Is there an option so I can turn it on? If PHP 4.1.0: try $_SERVER['HTTP_HOST'] instead. You can also set register_globals = On in the php.ini file (not recommended!) HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] gmdate()
The server needs to be set up correctly - it needs to know what time zone it is in and if the BIOS time is GMT or local. lallous wrote: Isn't the gmdate() supposed to return the same value when run from two different timezones? I run it on GMT+2 system and EDT system, and I get 1 hour difference, please advise. Elias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Undefined index, Undefined variable, Undefined constant....
[snip] I'm having trouble with the newest version of PHP (4.2.2). For example in a page I'm using the following code: if ($_GET['action'] == logout) { //do something } [/snip] As a quick troubleshooting method echo or print $_GET['action'] to see what, if anything, is contained there. I would also like to see more than; ...log_message reports: PHP Notice: Undefined index: action in HTH! Jay Here I am. Now what were your other two wishes? * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Web based FTP client
I am trying to build or find a web FTP client. I can create a server side FTP app in PHP no problem, but I would like the user to be able to browse their own file system. I thought about using upload functions with PHP FTP functions on the server but I didn't want just an input box with a browse button on the screen. I have also search though JavaScript for FTP functions but I didn't see anything that would really work. I want it to look like a windows based FTP client a list box on one site for the user's file system and a list box on the other for the ftp server. Does anyone know of a good web FTP program in exists or point me in the right direction on how to build one.. Thanks, Mark. _ Mark McCulligh, Application Developer / Analyst Sykes Canada Corporation www.SykesCanada.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined index, Undefined variable, Undefined constant....
I had the say problem, try this if($_POST['update'] == Update) { someting to do... } - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: 'Jens Winberg' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 06, 2002 5:12 PM Subject: RE: [PHP] Undefined index, Undefined variable, Undefined constant [snip] I'm having trouble with the newest version of PHP (4.2.2). For example in a page I'm using the following code: if ($_GET['action'] == logout) { file://do something } [/snip] As a quick troubleshooting method echo or print $_GET['action'] to see what, if anything, is contained there. I would also like to see more than; ...log_message reports: PHP Notice: Undefined index: action in HTH! Jay Here I am. Now what were your other two wishes? * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- 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
Re: [PHP] gmdate()
I don't own the server, and the server is probably set up correctly as it is a web hosting server. anyway, how should that RedHat 6 server be set up ? Elias Marek Kilimajer [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... The server needs to be set up correctly - it needs to know what time zone it is in and if the BIOS time is GMT or local. lallous wrote: Isn't the gmdate() supposed to return the same value when run from two different timezones? I run it on GMT+2 system and EDT system, and I get 1 hour difference, please advise. Elias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] which version to use?
hi What version combinations of php and mysql should be used? regards anil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] gmdate()
lets say, ServerOne has TimeZone GMT+2 ServerTwo has TimeZone GMT+3 the gmdate() will return diff values for the same timestamp. essentially there will be a diff of 1 hour in the return values from these two servers. -Naintara -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] t]On Behalf Of lallous Sent: Friday, September 06, 2002 8:55 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] gmdate() I don't own the server, and the server is probably set up correctly as it is a web hosting server. anyway, how should that RedHat 6 server be set up ? Elias Marek Kilimajer [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... The server needs to be set up correctly - it needs to know what time zone it is in and if the BIOS time is GMT or local. lallous wrote: Isn't the gmdate() supposed to return the same value when run from two different timezones? I run it on GMT+2 system and EDT system, and I get 1 hour difference, please advise. Elias -- 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: which version to use?
i used the stable versions avalible at each website. mysql 3.23 and apache 1.3 something never given me a problem and ive been running it for a few weeks.. let alone some ppl running them for months/years cheers Anil Garg [EMAIL PROTECTED] wrote in message 015701c255b3$a2704990$[EMAIL PROTECTED]">news:015701c255b3$a2704990$[EMAIL PROTECTED]... hi What version combinations of php and mysql should be used? regards anil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] which version to use?
Hi Anil, What version combinations of php and mysql should be used? PHP 4.2.2 is the latest and is highly recommended. For MySQL it depends somewhat on which features you need - if you can live without the stuff in the 4.x versions, you're probably best off with 3.23.52. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Web based FTP client
Hi Mark, I am trying to build or find a web FTP client. I want it to look like a windows based FTP client a list box on one site for the user's file system and a list box on the other for the ftp server. A couple of iframes side by side should let you do that. The biggest problem I can see you hitting is reading the contents of the user's hard drive... usually this is impossible, for good reasons. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: which version to use?
You should use both latest versions. PHP 4.2.2 www.php.net/downloads and MySQL 3.23.52 -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Anil Garg [EMAIL PROTECTED] a écrit dans le message de news: 015701c255b3$a2704990$[EMAIL PROTECTED] hi What version combinations of php and mysql should be used? regards anil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Image Resizing ... lets try this again.
I sent this email out earlier this morning and got no response. It was quite early so I thought I would send it again now that more people are hopefully at work :-) I have been trying to figure out the best way to resize photo quality images to thumbnail size and have them come out looking good. I have read about the function http://www.php.net/manual/en/function.imagecreatetruecolor.php http://www.php.net/manual/en/function.imagecreatetruecolor.php imagecreatetruecolor() and it looks like it may do this. However I do not have GD 2 installed which is required for this function to work. In the process of trying to figure out how to install GD v2 I came across the following page. http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.image.php On this page is says; Since PHP 4.3 there is a bundeled version of the GD lib. This bundeled version has some additional features like alpha blending and should be used in preference to the external library since it's codebase is better maintained and more stable. I thought the most recent version of php was 4.2.2? Anyway if there is a better way to resize images to create high quality thumbnails I would love to hear about it. I am on a redhat 7.3 server and not very familiar with linux. I would prefer not to have to take the time involved in learning how to install new packages right now, but realize this may be unavoidable. Thanks in advance for any help.
Re: [PHP] Image Resizing ... lets try this again.
What I found works very well for this is the function: getimagesize(); $image_file = something.jpg; $size = getimagesize($image_file); //$size[0] = height and $size[1] = width (double check on php.net) //Then just divide them... $width = $size[1]/2; $height=$size[0]/2; DISPLAY IMAHE height=$height width=$width This way it will keep the original deminsions of the photo, just cut it in half, or however much you want to cut it down. Of course this approach makes viewing eaiser, but does not really cut down on the download time of the JPG, so if that is your primary concern, then another approach may be in order? HTH -Brad I sent this email out earlier this morning and got no response. It was quite early so I thought I would send it again now that more people are hopefully at work :-) I have been trying to figure out the best way to resize photo quality images to thumbnail size and have them come out looking good. I have read about the function http://www.php.net/manual/en/function.imagecreatetruecolor.php http://www.php.net/manual/en/function.imagecreatetruecolor.php imagecreatetruecolor() and it looks like it may do this. However I do not have GD 2 installed which is required for this function to work. In the process of trying to figure out how to install GD v2 I came across the following page. http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.image.php On this page is says; Since PHP 4.3 there is a bundeled version of the GD lib. This bundeled version has some additional features like alpha blending and should be used in preference to the external library since it's codebase is better maintained and more stable. I thought the most recent version of php was 4.2.2? Anyway if there is a better way to resize images to create high quality thumbnails I would love to hear about it. I am on a redhat 7.3 server and not very familiar with linux. I would prefer not to have to take the time involved in learning how to install new packages right now, but realize this may be unavoidable. Thanks in advance for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image Resizing ... lets try this again.
If you can use exec you may use convert, or also imlib module provides very good results. Fifield, Mike wrote: I sent this email out earlier this morning and got no response. It was quite early so I thought I would send it again now that more people are hopefully at work :-) I have been trying to figure out the best way to resize photo quality images to thumbnail size and have them come out looking good. I have read about the function http://www.php.net/manual/en/function.imagecreatetruecolor.php http://www.php.net/manual/en/function.imagecreatetruecolor.php imagecreatetruecolor() and it looks like it may do this. However I do not have GD 2 installed which is required for this function to work. In the process of trying to figure out how to install GD v2 I came across the following page. http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.image.php On this page is says; Since PHP 4.3 there is a bundeled version of the GD lib. This bundeled version has some additional features like alpha blending and should be used in preference to the external library since it's codebase is better maintained and more stable. I thought the most recent version of php was 4.2.2? Anyway if there is a better way to resize images to create high quality thumbnails I would love to hear about it. I am on a redhat 7.3 server and not very familiar with linux. I would prefer not to have to take the time involved in learning how to install new packages right now, but realize this may be unavoidable. Thanks in advance for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sending email with linefeeds
Hi, we are sending plain-text-emails from php not using the mail-command but with port-operations. Everything works fine BUT outlook 2000 eats the linefeeds. We tried several things: copying the header from an original (functional) email from outlook, sending with \n or \r\n to seperate header-info and so on... nothing works. All email-clients show the mails correct - outlook 2000 doesn't. Since other mails are shown correct, there MUST be a way, but we don't know, which. Who can help? Thanx Kai -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: sending email with linefeeds
Kai Hinkelmann wrote: Hi, we are sending plain-text-emails from php not using the mail-command but with port-operations. Everything works fine BUT outlook 2000 eats the linefeeds. We tried several things: copying the header from an original (functional) email from outlook, sending with \n or \r\n to seperate header-info and so on... nothing works. All email-clients show the mails correct - outlook 2000 doesn't. Since other mails are shown correct, there MUST be a way, but we don't know, which. Who can help? Please paste a generated mail message (including header information), so we can have a look at it... Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: threads in Apache 1.3
At 08:04 PM 9/5/02 -0500, Richard Lynch wrote: I use persistant database connections and I wonder, if one connection is always in use by one page or by more? Each thread will end up having a connection. Actually, it will have a connection for *each* username/password combination used to connect, if you have multiple MySQL users in mysql_pconnect(...) snip More Apache children == More connections More MySQL username/passwords == More connections I assume a very large ISP with hundreds of customers has to: A) Give them all a common/shared username/password, *OR* B) Throw in a *LOT* of RAM to handle all the connections C) Ban persistant connections. They are great if you only have one site on a server, but too costly when there are many different username/passwords to the various databases. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Link for downloading?
Hello, How to create a link that when click it will lauch file downloading at client's end. And another question which might be biased from this topic, but still related with the subject of this message: why some downloading link will lauch a ftp client such as NetAnts or Download Accelerator while other link will start a Window's builtin download window? Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Link for downloading?
First, to create a link thats just a a href=.. that point to the file. ie a href=file.zipfile/a Second, that depend of your windows's default configuration. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Alex Shi [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hello, How to create a link that when click it will lauch file downloading at client's end. And another question which might be biased from this topic, but still related with the subject of this message: why some downloading link will lauch a ftp client such as NetAnts or Download Accelerator while other link will start a Window's builtin download window? Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Link for downloading?
Question 1: I think this has to do with how you attribute your file extensions in httpd.conf (Apache thing, not PHP), so check out the docs on apache.org Question 2: I woudl tend to believe it depends what kind of link it is... is it and HTTP downlaod site (which would use the windows save file as dialog, or is it a link to an FTP site, which may use your local FTP software... HTH -Brad Hello, How to create a link that when click it will lauch file downloading at client's end. And another question which might be biased from this topic, but still related with the subject of this message: why some downloading link will lauch a ftp client such as NetAnts or Download Accelerator while other link will start a Window's builtin download window? Alex -- 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] Calculating Totals from table columns without a second query to the DB
[thinking out loud] For small result sets where I am looking for column totals I generally issue 2 queries to the database, one for the data and one for the totals. This works fine, but for some things the database returns 100's or 1000's of records. To make this easier to use I page the records, showing an appropriate number of records for each page. The records for each page returned like so (normal); while($row = mysql_fetch_object($result)){ print(td . $row-value . /td\n); print(td . $row-another_value . /td\n); } The PHB would now like a totals per page and a grand totals. Easy enough with 3 queries each time the page is called, one for the records, one for the page totals, (using proper LIMIT queries) and one for the grand totals, but awfully inefficient and intensive. I suppose I could do something like this; while($row = mysql_fetch_object($result)){ print(td . $row-value . /td\n); print(td . $row-another_value . /td\n); $value1 = $value1 + $row-value; $value2 = $value2 + $row-another_value; } [/thinking out loud] In the process of typing this out I of course realized that this would work very well. Even if the database contains NULL values they are treated as zero. This gets me back to 2 queries, one of which only has to be issued once (the one for the grand totals, the results can be held in variables and echo'd or printed as needed). It also seems to be very efficient as the $value variables will only be doing a one time math operation each time through the while loop. For smaller results sets all on one page the same type of operation could be used for the grand totals as well, working the whole report down to a single query. I use a lot of crosstab queries where totals are needed along the bottom or right side, you can only do one within the original query. The other totals are left to another query ... usually. This should be a lesson to us all, we all try to over-compicate the issue sometimes. Usually a look at the docs/manual/FAQ/other-text-intensive-method-of-delivering-information will deliver the solution to a problem while some thought slowed to a reasonable speed (such as me typing out the problem above) will also allow natural logic to occur, producing a solution. Break down the process into managable portions, solving each portion before moving on to the next. Challenge; Can this be made as simple for rows too? Peace and I HTH someone else! Jay Hard work has a future payoff. Laziness pays off NOW. * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Calculating Totals from table columns without a second query to the DB
One thing I would add to Jay's out loud thoughts... Always consider alternative approaches. Using a single query and calculating the totals at the same time is fine if you have a small dataset, or (as in this case) are producing page totals (I'm assuming the dataset is paged to fit all on one page, so restricting the number of rows to 20, say). I had a situation where I had to report a bunch of stuff all at once, like 600 or 700 rows, and had to total 7 or 8 columns. In that case, I found it was far quicker to have separate queries for the row data and the totals, because the database was far quicker at totalling the stuff than the PHP code was. Now, where the cut off is I'm not sure. There are a huge number of factors which would be involved (size of dataset, choice of database, number of totals - and calculations required for these totals etc). I guess knowing plenty of alternatives - or at least understanding what you're doing enough to be able to think of alternatives - and thinking about stuff rather than just doing it the way you always did are the key points here. Just my tuppence... Richy == Richard Black Senior Developer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 951 3481 Email: [EMAIL PROTECTED] -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED]] Sent: 06 September 2002 16:33 To: [EMAIL PROTECTED] Subject: [PHP] Calculating Totals from table columns without a second query to the DB [thinking out loud] For small result sets where I am looking for column totals I generally issue 2 queries to the database, one for the data and one for the totals. This works fine, but for some things the database returns 100's or 1000's of records. To make this easier to use I page the records, showing an appropriate number of records for each page. The records for each page returned like so (normal); while($row = mysql_fetch_object($result)){ print(td . $row-value . /td\n); print(td . $row-another_value . /td\n); } The PHB would now like a totals per page and a grand totals. Easy enough with 3 queries each time the page is called, one for the records, one for the page totals, (using proper LIMIT queries) and one for the grand totals, but awfully inefficient and intensive. I suppose I could do something like this; while($row = mysql_fetch_object($result)){ print(td . $row-value . /td\n); print(td . $row-another_value . /td\n); $value1 = $value1 + $row-value; $value2 = $value2 + $row-another_value; } [/thinking out loud] In the process of typing this out I of course realized that this would work very well. Even if the database contains NULL values they are treated as zero. This gets me back to 2 queries, one of which only has to be issued once (the one for the grand totals, the results can be held in variables and echo'd or printed as needed). It also seems to be very efficient as the $value variables will only be doing a one time math operation each time through the while loop. For smaller results sets all on one page the same type of operation could be used for the grand totals as well, working the whole report down to a single query. I use a lot of crosstab queries where totals are needed along the bottom or right side, you can only do one within the original query. The other totals are left to another query ... usually. This should be a lesson to us all, we all try to over-compicate the issue sometimes. Usually a look at the docs/manual/FAQ/other-text-intensive-method-of-delivering-information will deliver the solution to a problem while some thought slowed to a reasonable speed (such as me typing out the problem above) will also allow natural logic to occur, producing a solution. Break down the process into managable portions, solving each portion before moving on to the next. Challenge; Can this be made as simple for rows too? Peace and I HTH someone else! Jay Hard work has a future payoff. Laziness pays off NOW. * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- 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
RE: [PHP] Calculating Totals from table columns without a second query to the DB
Hi Jay, while($row = mysql_fetch_object($result)){ print(td . $row-value . /td\n); print(td . $row-another_value . /td\n); $value1 = $value1 + $row-value; $value2 = $value2 + $row-another_value; } Challenge; Can this be made as simple for rows too? thinking out loud :-) ?php $rowTotals = array (); while ($row = mysql_fetch_object($result)) { $rowTotal = 0; foreach ($row as $key=$val) $rowTotal += $val; // display whatever is needed from $row $rowTotals[] = $rowTotal; // or echo it out to the last column of the table } ? /tol I don't usually use mysql_fetch_object so I'm not sure if you can walk through it with foreach() though... Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Web based FTP client
Reading the users hard drive is impossible from php, but it's really easy with Java. -Original Message- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: Friday, September 06, 2002 7:49 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Web based FTP client Hi Mark, I am trying to build or find a web FTP client. I want it to look like a windows based FTP client a list box on one site for the user's file system and a list box on the other for the ftp server. A couple of iframes side by side should let you do that. The biggest problem I can see you hitting is reading the contents of the user's hard drive... usually this is impossible, for good reasons. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and Apache
Is there any easy way of creating,editing and deleting virtual hosts using PHP via a website?? I have already thought of a way but seems a little long winded. Thanks in advance. Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Here is a email
Thanks for your answer. Here is a genereted email: Return-Path: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Received: (qmail 21481 invoked from network); 6 Sep 2002 15:47:03 - Received: from notused.i-dea.de (HELO mail.e-h.de) (62.26.122.219) by ns.i-dea.de with SMTP; 6 Sep 2002 15:47:03 - From:[EMAIL PROTECTED] Subject:Testmail Date:Fri, 6 Sep 2002 17:51:28 To: Reply-To:[EMAIL PROTECTED] MIME-Version:1.0 Content-Type:text/plain; charset=iso-8859-1 X-UIDL: _7F!!bMh!!~Ea!9Bn! first line second line third line the three lines are seperated with 0d0a, just as outlook would seperate them but the lines are not shown as a stack but as ONE line. Kai -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: sending email with linefeeds
I can't believe that I hit wrong buttons two times... so my answer for the third time... Thanks for your answer. Here is a genereted email: Return-Path: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Received: (qmail 21481 invoked from network); 6 Sep 2002 15:47:03 - Received: from notused.i-dea.de (HELO mail.e-h.de) (62.26.122.219) by ns.i-dea.de with SMTP; 6 Sep 2002 15:47:03 - From:[EMAIL PROTECTED] Subject:Testmail Date:Fri, 6 Sep 2002 17:51:28 To: Reply-To:[EMAIL PROTECTED] MIME-Version:1.0 Content-Type:text/plain; charset=iso-8859-1 X-UIDL: _7F!!bMh!!~Ea!9Bn! first line second line third line the three lines are seperated with 0d0a, just as outlook would seperate them but the lines are not shown as a stack but as ONE line. Kai Erwin [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Kai Hinkelmann wrote: Hi, we are sending plain-text-emails from php not using the mail-command but with port-operations. Everything works fine BUT outlook 2000 eats the linefeeds. We tried several things: copying the header from an original (functional) email from outlook, sending with \n or \r\n to seperate header-info and so on... nothing works. All email-clients show the mails correct - outlook 2000 doesn't. Since other mails are shown correct, there MUST be a way, but we don't know, which. Who can help? Please paste a generated mail message (including header information), so we can have a look at it... Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Link for downloading?
Thanks...but how to use header() to generate such a download link? Alex [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... First, to create a link thats just a a href=.. that point to the file. ie a href=file.zipfile/a Second, that depend of your windows's default configuration. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Alex Shi [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hello, How to create a link that when click it will lauch file downloading at client's end. And another question which might be biased from this topic, but still related with the subject of this message: why some downloading link will lauch a ftp client such as NetAnts or Download Accelerator while other link will start a Window's builtin download window? Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php