php-general Digest 6 Oct 2005 21:41:39 -0000 Issue 3723
and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' ---End Message--- ---BeginMessage--- You don't have to put anything specific, it just stops the script from executing. You can optionally put text in there. I like using die() for some reason (shorter? more.. err.. aggressive? hah) so I'll using commands like: die(Made it to this point...); I might use this to see if I got to a certain conditional or not.. Anyway, if you're getting that error, then there's definitely something being sent before the header() is executed. Check any require() or include() files, check all the code above your header() statement. So far I've never seen or heard of any bugs with header() where it'd mysteriously bomb out in this manner, it's always been something output and it's always been something people kick themselves for not seeing before. hah Keep looking, you'll find it. -TG = = = Original message = = = I checked and no white space involved. What would I need to put tin the exit()/die() function? -- ::Bruce:: ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. ---End Message--- ---BeginMessage--- when I put the die statment in and test the form I get, the html prior to the form and what I put in my die statement eg:made it to this point. The form submits and I get the info, but I am not redirected to the Thanks page. My question is how do I determine from this what is causing my error? On 10/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: You don't have to put anything specific, it just stops the script from executing. You can optionally put text in there. I like using die() for some reason (shorter? more.. err.. aggressive? hah) so I'll using commands like: die(Made it to this point...); I might use this to see if I got to a certain conditional or not.. Anyway, if you're getting that error, then there's definitely something being sent before the header() is executed. Check any require() or include() files, check all the code above your header() statement. So far I've never seen or heard of any bugs with header() where it'd mysteriously bomb out in this manner, it's always been something output and it's always been something people kick themselves for not seeing before. hah Keep looking, you'll find it. -TG = = = Original message = = = I checked and no white space involved. What would I need to put tin the exit()/die() function? -- ::Bruce:: ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- ::Bruce:: ---End Message--- ---BeginMessage--- http://news.yahoo.com/s/pcworld/20051006/tc_pcworld/122874 -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- I'm trying to setcookie('username',$username,15552000) but on subsequent pages $_COOKIE('username') is always null. I verified that I'm setting it before any other output is sent to the browser. I verified that $username does have some valid contents. I also verified that the browsers I'm testing are set to allow all cookies. I do have a $username and a $_SESSION['username'] that contain the same data. I'm all out of ideas for where to look further to debug this - any suggestions? ---End Message--- ---BeginMessage--- I'm trying to setcookie('username',$username,15552000) but on subsequent pages $_COOKIE('username') is always null. I verified that I'm setting it before any other output is sent to the browser. I verified that $username does have some valid contents. I also verified that the browsers I'm testing are set to allow all cookies. I do have a $username and a $_SESSION ['username'] that contain the same data. Well, the stupid/obvious question is: are you checking $_COOKIE ('username') like you posted or $_COOKIE['username'], which is syntactically correct? Secondarily, have you set your browser to prompt you when a cookie is sent and, if so, what happens? Larry ---End Message--- ---BeginMessage--- Brian Dunning wrote: I'm trying to setcookie('username',$username,15552000) but on subsequent pages $_COOKIE('username') is always null. snip Is that just a typo? It should be $_COOKIE['username'] -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- On Oct 6, 2005, at 7:28 AM, John Nichel wrote: Is that just a typo? It should be $_COOKIE['username'] Oops, yes, that was my typo in the email - it is correctly $_COOKIE ['username
[PHP] Detect file size BEFORE upload it
Hi, I have been trying _several_ ways to control the size of the files that can be uploaded in a form. The problem is that I was able to detect file size after complete file is transfered. I need to detect file size before all file is transfered, in order to cancel it and preserve server resources. Any ideas? Thanks in advance Ruben Rubio Rey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Detect file size BEFORE upload it
Ruben wrote: I have been trying _several_ ways to control the size of the files that can be uploaded in a form. The problem is that I was able to detect file size after complete file is transfered. I need to detect file size before all file is transfered, in order to cancel it and preserve server resources. Not possible unless you can write your own client app. Javascript etc.'s access to file controls is heavily restricted. -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Detect file size BEFORE upload it
Saswat Praharaj wrote: I guess checking the content-length field in HTTP header will help you. I have already tried it. PHP can read content-length after complete file is transferred. Regds, -Saswat On 10/6/05, Ruben [EMAIL PROTECTED] wrote: Hi, I have been trying _several_ ways to control the size of the files that can be uploaded in a form. The problem is that I was able to detect file size after complete file is transfered. I need to detect file size before all file is transfered, in order to cancel it and preserve server resources. Any ideas? Thanks in advance Ruben Rubio Rey -- 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] caching parsed XML files... FALSE advice, still not working
Petr Smith wrote: Jasper Bryant-Greene wrote: Petr Smith wrote: is it possible to cache parsed XML files somehow? I'm writing template library based on XML. But it's not very efficient to create new DomDocument, load XML template, process it and show on every page hit. XML parsing is not very fast, and because I'm parsing XHTML with entities, all DTD's are parsed too. I thought about something similar to java - there I can have servlet which lives all the time the server lives. It can load XML and parse it only for the first time and send DOM objects to another servlets. I need something similar with PHP, can it be done? This question seems to come up every other week on this list. Have a look at APC[1]; you can cache objects with its apc_store() and apc_fetch() functions. [1] http://php.net/apc Thanks, looks usable.. I hope it can synchronize successfully between different calls on heave load. I'll try it, I don't know why I missed it when browsing documentation. Petr Hi, it's not working at all. And it could never work. I don't think it's funny to write false advices to people every other week. I've installed APC cache, tried to save XML. It was not working. apc_fetch returned NULL every time. $dom = apc_fetch(dom); if ($dom === false) { $dom = new DomDocument(); $dom-load(browsers.html); $store = apc_store(dom, $dom); echo store finished: $store; } echo $dom-saveXML(); When I looked into documentation for APC - there is this sentence: And apc_store() currently doesn't work at all for (internal) classes in PHP5 right now.. And all the XML stuff is what? Internal PHP5 classes! Please don't confuse people with false edvices next time. Better to say nothing then solutions that are not working. I lost lot of time and got only ton of disapointment. And still no solution to my problem :(. Petr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] caching parsed XML files... FALSE advice, still not working
Petr Smith wrote: it's not working at all. And it could never work. I don't think it's funny to write false advices to people every other week. I've installed APC cache, tried to save XML. It was not working. apc_fetch returned NULL every time. [snip] When I looked into documentation for APC - there is this sentence: And apc_store() currently doesn't work at all for (internal) classes in PHP5 right now.. And all the XML stuff is what? Internal PHP5 classes! I can only apologise for your wasted time -- I seem to remember it working but may have been caching a different class; it was a while ago. Perhaps Rasmus or someone with more knowledge of APC internals could comment? I find APC very useful but it would be extremely useful to be able to cache the DOMDocument class. Could you please post the link to the docs from which you got that quote? I cannot find any words to that effect on either the php.net or pecl.php.net websites, but maybe I'm not looking hard enough... -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] caching parsed XML files as DOM objects in memory
it's not working at all. And it could never work. I don't think it's funny to write false advices to people every other week. I've installed APC cache, tried to save XML. It was not working. apc_fetch returned NULL every time. [snip] When I looked into documentation for APC - there is this sentence: And apc_store() currently doesn't work at all for (internal) classes in PHP5 right now.. And all the XML stuff is what? Internal PHP5 classes! I can only apologise for your wasted time -- I seem to remember it working but may have been caching a different class; it was a while ago. Perhaps Rasmus or someone with more knowledge of APC internals could comment? I find APC very useful but it would be extremely useful to be able to cache the DOMDocument class. Could you please post the link to the docs from which you got that quote? I cannot find any words to that effect on either the php.net or pecl.php.net websites, but maybe I'm not looking hard enough... Apology accepted. Sorry for my (maybe) too offensive language, I was disappointed it's not working. This quote is from TODO Known Bugs file inside apc distribution archive (v3.0.8). Petr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail() with port authentication
Do I need to use Pear to specify port 587 and authentication when sending mail? I could not find any way to do it using mail(). Windows or Unix? On Windows you can set the port by setting smtp_port in php.ini. Unix doesn't appear to have a direct equivalent, but you might be able to do something with sendmail_path? As for SMTP authentication, when I wanted to do this on Windows I went for phpmailer http://phpmailer.sourceforge.net/ Hope this is of some help Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do I POST data with headers make the browser follow?
Hi guys/girls, I have to apologize if this issue has been discussed in detail before but I couldn't find anything obvious so far. What I need/want to do is to : 1. Take POST data from a form (no problem) 2. Do whatever i need to on the target page (no problem) 3. Pass some other data on to a 3rd page as a POST request. 4. Get the browser to follow to said 3rd page. All this is happening via SSL. So basically what i am trying to do is to fake whatever happens at a normal POST request that is handled by the browser. Now point 4. in my example above is giving me a massive headache, I have managed to pass data on to the 3rd page as POST quite comfortably using cURL but the browser doesn't follow (ie. the URL in the address bar remains unchanged). I did see that there is a FOLLOWLOCATION option you can set in cURL when you do you request, and though wicked, just what I needed only to find out that it's not working (probably because I understand what it does wrong). Pretty pretty please if anyone knows a solution for the above, let me know. Oh, and I'd also like to add that the information I am trying to get to the 3rd page in the example is sensitive (Credit Card details etc.), so $_GET and $_COOKIE are out of the question. ANY help would be appreciated. Kind regards, Ben -- 5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail +++ GMX - die erste Adresse für Mail, Message, More +++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Detect file size BEFORE upload it
Hi Ruben, Thursday, October 6, 2005, 7:38:35 AM, you wrote: The problem is that I was able to detect file size after complete file is transfered. I need to detect file size before all file is transfered, in order to cancel it and preserve server resources. Any ideas? The only way to do it would be to write your own client uploading application in the likes of Java or ActiveX. Anything client side is always going to fail because it doesn't know about the size of the file until it has it, by which point it's too late. Cheers, Rich -- Zend Certified Engineer http://www.launchcode.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I POST data with headers make the browser follow?
If the information is sensitive, why are you trying to fake a POST submission? A POST can be received from anywhere. SSL is just encrypting it, not verifying the client is the same. I would use session variables to store information you need to access from page to page. That way you can verify that you are talking to the same computer from the first two pages. On Oct 6, 2005, at 5:52 AM, Ragnar wrote: Hi guys/girls, I have to apologize if this issue has been discussed in detail before but I couldn't find anything obvious so far. What I need/want to do is to : 1. Take POST data from a form (no problem) 2. Do whatever i need to on the target page (no problem) 3. Pass some other data on to a 3rd page as a POST request. 4. Get the browser to follow to said 3rd page. All this is happening via SSL. So basically what i am trying to do is to fake whatever happens at a normal POST request that is handled by the browser. Now point 4. in my example above is giving me a massive headache, I have managed to pass data on to the 3rd page as POST quite comfortably using cURL but the browser doesn't follow (ie. the URL in the address bar remains unchanged). I did see that there is a FOLLOWLOCATION option you can set in cURL when you do you request, and though wicked, just what I needed only to find out that it's not working (probably because I understand what it does wrong). Pretty pretty please if anyone knows a solution for the above, let me know. Oh, and I'd also like to add that the information I am trying to get to the 3rd page in the example is sensitive (Credit Card details etc.), so $_GET and $_COOKIE are out of the question. ANY help would be appreciated. Kind regards, Ben -- 5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail +++ GMX - die erste Adresse für Mail, Message, More +++ -- 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
[PHP] Re: How do I POST data with headers make the browser follow?
I have to apologize if this issue has been discussed in detail before but I couldn't find anything obvious so far. What I need/want to do is to : 1. Take POST data from a form (no problem) 2. Do whatever i need to on the target page (no problem) 3. Pass some other data on to a 3rd page as a POST request. 4. Get the browser to follow to said 3rd page. All this is happening via SSL. So basically what i am trying to do is to fake whatever happens at a normal POST request that is handled by the browser. Now point 4. in my example above is giving me a massive headache, I have managed to pass data on to the 3rd page as POST quite comfortably using cURL but the browser doesn't follow (ie. the URL in the address bar remains unchanged). I did see that there is a FOLLOWLOCATION option you can set in cURL when you do you request, and though wicked, just what I needed only to find out that it's not working (probably because I understand what it does wrong). Pretty pretty please if anyone knows a solution for the above, let me know. Oh, and I'd also like to add that the information I am trying to get to the 3rd page in the example is sensitive (Credit Card details etc.), so $_GET and $_COOKIE are out of the question. Hi, it seems you have no understanding how http protocol works.. I can't learn you the whole thing, but I can give you some hints. Read something about HTTP (http://www.digital-web.com/articles/powering_the_web_with_http/), install some network sniffer (ethereal, HttpWatch for IE - great tool for beginners) and see what happens. - you cannot force browser to POST something somewhere with PHP. You have to realize, that PHP is running on server, but the browser is the client. - you cannot use curl to do it. With curl it all happens on the server. If you want to use curl, you have to use same technique used by web based anonymous proxy. Return all loaded data to client, rewrite urls to your script, handle everything correctly until client closes browser. Very complex stuff - followlocation has nothing to do with browser. it only says to curl to evaluate Location header and do auto-redirection - sensitive information? GET, POST, COOKIE, everything could be intercepted - your only help is javascript. You can generate something like this to client browser with php. But you couldn't hide sensitive information this way. body onload=document.forms.myform.submit() form name=myform method=post input type=hidden name=... value=... /form - think about your problem and possible solutions again Petr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page
when I add that code I can the following error msg when submitting the form. *Warning*: Cannot modify header information - headers already sent by (output started at /home/webadmin/dedicated75.virtual.vps- host.net/html/fortuneInteractive/Consultation_test.php:6http://host.net/html/fortuneInteractive/Consultation_test.php:6) in */home/webadmin/dedicated75.virtual.vps- host.net/html/fortuneInteractive/Consultation_test.phphttp://host.net/html/fortuneInteractive/Consultation_test.php * on line *168* line 168 is the one with header( 'Location: thanks.php' ); on it. can anyone explain why this is happening and how to rectify? TIA On 10/5/05, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2005-10-05 at 21:15, Bruce Gilbert wrote: thanks for the reply. and where on the page would that need to go? Within the head tags? and would it need to be within ?php ? Right after this line: mail ($to, $subject, $msg, $mailheaders); And you will already be within PHP interpretation. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- ::Bruce::
[PHP] Creator in the news
http://news.yahoo.com/s/pcworld/20051006/tc_pcworld/122874 -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page
Check to make sure absolutely nothing before the header() function is outputing anything. No echos, no prints, no var_dumps, no HTML or even blank lines. If it's something tangible like an echo or print or something, then putting an exit()/die() function right before the header() function then looking at the HTML source that you get should show you what the offending output is. But again, if I recall, it can be something as simple as an empty line. - ?php // This should work because there's no output or white space above header() header('Location: thanks.php'); ? - - ?php // This should fail (if I recall) because of the blank line that's sent // before the PHP code block. This is considered output, and can't come before // any header statements header('Location: thanks.php'); ? - = = = Original message = = = when I add that code I can the following error msg when submitting the form. *Warning*: Cannot modify header information - headers already sent by (output started at /home/webadmin/dedicated75.virtual.vps- host.net/html/fortuneInteractive/Consultation_test.php:6http://host.net/html/fortuneInteractive/Consultation_test.php:6) in */home/webadmin/dedicated75.virtual.vps- host.net/html/fortuneInteractive/Consultation_test.phphttp://host.net/html/fortuneInteractive/Consultation_test.php * on line *168* line 168 is the one with header( 'Location: thanks.php' ); on it. can anyone explain why this is happening and how to rectify? TIA On 10/5/05, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2005-10-05 at 21:15, Bruce Gilbert wrote: thanks for the reply. and where on the page would that need to go? Within the head tags? and would it need to be within ?php ? Right after this line: mail ($to, $subject, $msg, $mailheaders); And you will already be within PHP interpretation. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- ::Bruce:: ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I POST data with headers make the browser follow?
1. Take POST data from a form (no problem) 2. Do whatever i need to on the target page (no problem) 3. Pass some other data on to a 3rd page as a POST request. 4. Get the browser to follow to said 3rd page. All this is happening via SSL. What the other people said about HTTP. It's time to look at this from another angle. Why do you need to process this data twice? What are you trying to do? Are you, perhaps, trying to make an online payment where you store the data locally (page 2), then perform some kind of credit check (page 3)? If so, would something like the following work? Page 1 - form post to page 2 Page 2: process form inputs, write to DB or whatever, communicate with page 3 as necessary (possibly using curl) and finally send a redirection header to the browser sending it to a success/failure page based on what page 3 told you -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] setcookie() is not my friend
I'm trying to setcookie('username',$username,15552000) but on subsequent pages $_COOKIE('username') is always null. I verified that I'm setting it before any other output is sent to the browser. I verified that $username does have some valid contents. I also verified that the browsers I'm testing are set to allow all cookies. I do have a $username and a $_SESSION['username'] that contain the same data. I'm all out of ideas for where to look further to debug this - any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] setcookie() is not my friend
I'm trying to setcookie('username',$username,15552000) but on subsequent pages $_COOKIE('username') is always null. I verified that I'm setting it before any other output is sent to the browser. I verified that $username does have some valid contents. I also verified that the browsers I'm testing are set to allow all cookies. I do have a $username and a $_SESSION ['username'] that contain the same data. Well, the stupid/obvious question is: are you checking $_COOKIE ('username') like you posted or $_COOKIE['username'], which is syntactically correct? Secondarily, have you set your browser to prompt you when a cookie is sent and, if so, what happens? Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] setcookie() is not my friend
Brian Dunning wrote: I'm trying to setcookie('username',$username,15552000) but on subsequent pages $_COOKIE('username') is always null. snip Is that just a typo? It should be $_COOKIE['username'] -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page
I checked and no white space involved. What would I need to put tin the exit()/die() function? On 10/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Check to make sure absolutely nothing before the header() function is outputing anything. No echos, no prints, no var_dumps, no HTML or even blank lines. If it's something tangible like an echo or print or something, then putting an exit()/die() function right before the header() function then looking at the HTML source that you get should show you what the offending output is. But again, if I recall, it can be something as simple as an empty line. - ?php // This should work because there's no output or white space above header() header('Location: thanks.php'); ? - - ?php // This should fail (if I recall) because of the blank line that's sent // before the PHP code block. This is considered output, and can't come before // any header statements header('Location: thanks.php'); ? - = = = Original message = = = when I add that code I can the following error msg when submitting the form. *Warning*: Cannot modify header information - headers already sent by (output started at /home/webadmin/dedicated75.virtual.vps- host.net/html/fortuneInteractive/Consultation_test.php:6http://host.net/html/fortuneInteractive/Consultation_test.php:6 http://host.net/html/fortuneInteractive/Consultation_test.php:6) in */home/webadmin/dedicated75.virtual.vps- host.net/html/fortuneInteractive/Consultation_test.phphttp://host.net/html/fortuneInteractive/Consultation_test.php http://host.net/html/fortuneInteractive/Consultation_test.php * on line *168* line 168 is the one with header( 'Location: thanks.php' ); on it. can anyone explain why this is happening and how to rectify? TIA On 10/5/05, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2005-10-05 at 21:15, Bruce Gilbert wrote: thanks for the reply. and where on the page would that need to go? Within the head tags? and would it need to be within ?php ? Right after this line: mail ($to, $subject, $msg, $mailheaders); And you will already be within PHP interpretation. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- ::Bruce:: ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- ::Bruce::
Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page
Here's the simple solution (put it at the top of your script: ob_start(); Cheers, Rob. On Thu, 2005-10-06 at 10:30, Bruce Gilbert wrote: I checked and no white space involved. What would I need to put tin the exit()/die() function? On 10/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Check to make sure absolutely nothing before the header() function is outputing anything. No echos, no prints, no var_dumps, no HTML or even blank lines. If it's something tangible like an echo or print or something, then putting an exit()/die() function right before the header() function then looking at the HTML source that you get should show you what the offending output is. But again, if I recall, it can be something as simple as an empty line. - ?php // This should work because there's no output or white space above header() header('Location: thanks.php'); ? - - ?php // This should fail (if I recall) because of the blank line that's sent // before the PHP code block. This is considered output, and can't come before // any header statements header('Location: thanks.php'); ? - = = = Original message = = = when I add that code I can the following error msg when submitting the form. *Warning*: Cannot modify header information - headers already sent by (output started at /home/webadmin/dedicated75.virtual.vps- host.net/html/fortuneInteractive/Consultation_test.php:6http://host.net/html/fortuneInteractive/Consultation_test.php:6 http://host.net/html/fortuneInteractive/Consultation_test.php:6) in */home/webadmin/dedicated75.virtual.vps- host.net/html/fortuneInteractive/Consultation_test.phphttp://host.net/html/fortuneInteractive/Consultation_test.php http://host.net/html/fortuneInteractive/Consultation_test.php * on line *168* line 168 is the one with header( 'Location: thanks.php' ); on it. can anyone explain why this is happening and how to rectify? TIA On 10/5/05, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2005-10-05 at 21:15, Bruce Gilbert wrote: thanks for the reply. and where on the page would that need to go? Within the head tags? and would it need to be within ?php ? Right after this line: mail ($to, $subject, $msg, $mailheaders); And you will already be within PHP interpretation. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- ::Bruce:: ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- ::Bruce:: -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] setcookie() is not my friend
On Oct 6, 2005, at 7:28 AM, John Nichel wrote: Is that just a typo? It should be $_COOKIE['username'] Oops, yes, that was my typo in the email - it is correctly $_COOKIE ['username'] in the code. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page
You don't have to put anything specific, it just stops the script from executing. You can optionally put text in there. I like using die() for some reason (shorter? more.. err.. aggressive? hah) so I'll using commands like: die(Made it to this point...); I might use this to see if I got to a certain conditional or not.. Anyway, if you're getting that error, then there's definitely something being sent before the header() is executed. Check any require() or include() files, check all the code above your header() statement. So far I've never seen or heard of any bugs with header() where it'd mysteriously bomb out in this manner, it's always been something output and it's always been something people kick themselves for not seeing before. hah Keep looking, you'll find it. -TG = = = Original message = = = I checked and no white space involved. What would I need to put tin the exit()/die() function? -- ::Bruce:: ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Detect file size BEFORE upload it
:) U have it. Its perferct. Im gonna check it, but seems to be the solution. Raditha Dissanayake wrote: While you are at SF checkout Mega Upload. Ruben Rubio Rey wrote: Anyway, if I would use any applet I ll use one of sourceforge.net. Its free and I can modify source, so I can personalize it... But thanks by the idea! :) Raditha Dissanayake wrote: Hello Ruben, Ruben Rubio Rey wrote: Raditha Dissanayake wrote: Shameless plug: you need a java upload applet such as Rad Upload (http://www.radinks.com/upload/) Ruben wrote: Thats actually good idea, but I would not want to use Flash or Java applets. I respect your opinion. If you ever change your mind please do consider Rad Upload it's being used by quite a few image hosting companies. thanks and best regards raditha Hi, I have been trying _several_ ways to control the size of the files that can be uploaded in a form. The problem is that I was able to detect file size after complete file is transfered. I need to detect file size before all file is transfered, in order to cancel it and preserve server resources. Any ideas? Thanks in advance Ruben Rubio Rey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP and XML
Quoting Robbert van Andel [EMAIL PROTECTED]: Thanks, I'm investigating XSL and it looks pretty good. We use an RPM based installation of PHP version 5.0.4. I see on PHP.net's website that XSL comes standard with PHP 5 and you need to enable it by adding the argument --with-xsl to the configure line. How do I do this when we did not build PHP from source? Is there another way to get XSL activated? Thanks for your help Robbert You don't mention which distro you're using, but Fedora Core 4 has a php-xml rpm to ...add support to PHP for manipulating XML documents using the DOM tree, and performing XSL transformations on XML documents. Hope this helps, Rick -- Rick Emery When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for there you have been, and there you will always long to return -- Leonardo Da Vinci -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page
when I put the die statment in and test the form I get, the html prior to the form and what I put in my die statement eg:made it to this point. The form submits and I get the info, but I am not redirected to the Thanks page. My question is how do I determine from this what is causing my error? On 10/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: You don't have to put anything specific, it just stops the script from executing. You can optionally put text in there. I like using die() for some reason (shorter? more.. err.. aggressive? hah) so I'll using commands like: die(Made it to this point...); I might use this to see if I got to a certain conditional or not.. Anyway, if you're getting that error, then there's definitely something being sent before the header() is executed. Check any require() or include() files, check all the code above your header() statement. So far I've never seen or heard of any bugs with header() where it'd mysteriously bomb out in this manner, it's always been something output and it's always been something people kick themselves for not seeing before. hah Keep looking, you'll find it. -TG = = = Original message = = = I checked and no white space involved. What would I need to put tin the exit()/die() function? -- ::Bruce:: ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- ::Bruce::
Re: [PHP] setcookie() is not my friend
Unless I'm mistaken, you appear to be setting the Expiration date of the cookie to Mon, 29 Jun 1970 17:00:00 -0700. Which would cause the cookie to be unset, if it were already set, and do nothing otherwise. Chris Brian Dunning wrote: I'm trying to setcookie('username',$username,15552000) but on subsequent pages $_COOKIE('username') is always null. I verified that I'm setting it before any other output is sent to the browser. I verified that $username does have some valid contents. I also verified that the browsers I'm testing are set to allow all cookies. I do have a $username and a $_SESSION['username'] that contain the same data. I'm all out of ideas for where to look further to debug this - any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] setcookie() is not my friend
Good catch, Chris. I was wondering about that myself but hadn't taken the time to see if setcookie() used regular serial time or if cookies had another time standard. echo date(m/d/Y h:i:s, 15552000); 06/29/1970 08:00:00 That's what I get. -TG = = = Original message = = = Unless I'm mistaken, you appear to be setting the Expiration date of the cookie to Mon, 29 Jun 1970 17:00:00 -0700. Which would cause the cookie to be unset, if it were already set, and do nothing otherwise. Chris Brian Dunning wrote: I'm trying to setcookie('username',$username,15552000) but on subsequent pages $_COOKIE('username') is always null. I verified that I'm setting it before any other output is sent to the browser. I verified that $username does have some valid contents. I also verified that the browsers I'm testing are set to allow all cookies. I do have a $username and a $_SESSION['username'] that contain the same data. I'm all out of ideas for where to look further to debug this - any suggestions? ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Detect file size BEFORE upload it
I know that part of the POST transaction with the client and web server involves sending the 'content-length'.. there's no way to tap into that before the file's uploaded though I guess. (example of how to manually POST using Python at leastfound here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306) Failing that.. I think someone had mentioned Java, but here's a quick and dirty way to do it in Javascript (found on: https://lists.latech.edu/pipermail/javascript/2003-April/005190.html) var myFile = new File(c:\temp\myfile.txt); myFile.open(r); alert('myFile length: ' + myFile.getLength()); Havn't tested it, but I'd rather use a tiny Javascript than a Java applet. My apologies if I missed something in the thread, I kind of speed read through it and wasn't going to respond, but it was nagging at the back of my brain so I had to do a quick search or two.. hah -TG = = = Original message = = = Hi, I have been trying _several_ ways to control the size of the files that can be uploaded in a form. The problem is that I was able to detect file size after complete file is transfered. I need to detect file size before all file is transfered, in order to cancel it and preserve server resources. Any ideas? Thanks in advance Ruben Rubio Rey ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] setcookie() is not my friend
D'Oh! You guys are absolutely right. I was trying to go for 6 months, which works now if I say time()+15552000 instead of 15552000. And the documentation shows that exactly - apparently I read right over it, even though I studied it minutely before posting. Oh well...my wife would have the same complaint about me when I can't find the can opener when it's sitting in plain view. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SOAP problem, (related to gethostbyname?)
I'm using the PEAR Soap package and having problem accessing another sites's webservices. When i do something like this: ?PHP $wsdl_url = 'some_wsdl.xml'; $WSDL = new SOAP_WSDL($wsdl_url); $client = $WSDL-getProxy(); $web_service_result = $client - some_web_service($param1,$param2,$param3,$param4); ? $web_service_result returns the soap_fault Object. The message portion contains the line curl_exec error 6 Couldn't resolve host 'secure.example.com' Also if i try to grab the WSDL file from the remote server the script doesn't seem to grab the WSDL ( i get a bunch of Passed variable is not an array or object errors ). I think the problem is curl can't resolve the hostname. Also if i run ?PHP echo gethostbyname('http://bugs.php.net'); ? It echos http://bugs.php.net;, no good. When i try something like ?PHP $url = 'https://secure.example.com/index.html'; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER,TRUE); $result = curl_exec($ch); $cur_error = curl_error($ch); curl_close($ch); echo $result; echo BR Error: .$cur_error; ? It doesn't echo out anything, however if run curl https://secure.example.com/index.html; from the command line i get back the page found at that address. I'm running PHP Version 4.3.4 with CURL support enabled (CURL Information: libcurl 7.9.8 (OpenSSL 0.9.7c) (ipv6 enabled) ) on Red Had. If i ping 'secure.example.com' the address resolves properly. Any tips on things to try? Should i reinstall curl? SSL? Anything else i should investigate? -k. __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DB] Search Replace within PHP
str_replace() is the first thing that comes to mind. From the manual: // Provides: body text='black' $bodytag = str_replace(%body%, black, body text='%body%'); Using %keyword% and is kind of a template style method, but has worked out well for me (and I assume others) so try something along those lines. You can also use arrays with str_replace to indicate a list of things that need replacing: $template = Please forward this to %NAME% at %ADDRESS%. Call them at %PHONE% if there's a problem; $tags = array(%NAME%, %ADDRESS%, %PHONE%); $userinfoQY = select Name, Address, Phone from users; $userinfoRS = mysql_query($userinfoQY); while($userinfoRW = mysql_fetch_assoc($userinfoRS)){ $userinfo = array($userinfoRW['Name'], $userinfoRW['Address'], $userinfoRW['Phone']); echo str_replace($tags, $userinfo, $templte); } Is that the answer you were looking for? -TG = = = Original message = = = Is there a search replace PHP command? An example I am needing this for would be: My name is replace_with_real_name I want to retrieve replace_with_real_name from a mySQL database and put in the name ... the key is that I want to put the person's name in various position ... so I want to search for something like replace_with_real_name and be able to put it anywhere in the sentence. Ron ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Detect file size BEFORE upload it
[EMAIL PROTECTED] wrote: var myFile = new File(c:\temp\myfile.txt); myFile.open(r); alert('myFile length: ' + myFile.getLength()); Somehow I don't think any browser is going to give JS access to arbitrary files on the user's system like that. -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Detect file size BEFORE upload it
Yeah, you're right. I didn't test that before I posted it. Looks like you can do it as long as your clients are running Windows and you can use Active X or another Windows trick using something like JScript, but with pure Javascript it looks bleak. I tried to use something like this: img = New Image(); img.src = somefile.ext; // NOT an image file alert(img.fileSize); But found out that this is an IE-only trick as well. Nobody else seems to support the filesize property on image objects. Funny thing is, even in IE it didn't work. Even when I actually used an image for the file name. Oh well.. guess that Java applet might be the best way then, to keep it cross platform and all that. -Tg = = = Original message = = = [EMAIL PROTECTED] wrote: var myFile = new File(c:\temp\myfile.txt); myFile.open(r); alert('myFile length: ' + myFile.getLength()); Somehow I don't think any browser is going to give JS access to arbitrary files on the user's system like that. -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/ ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] setcookie() is not my friend
On Thu, October 6, 2005 9:11 am, Brian Dunning wrote: I'm trying to setcookie('username',$username,15552000) but on subsequent pages $_COOKIE('username') is always null. I verified that I'm setting it before any other output is sent to the browser. I verified that $username does have some valid contents. I also verified that the browsers I'm testing are set to allow all cookies. I do have a $username and a $_SESSION['username'] that contain the same data. I'm all out of ideas for where to look further to debug this - any suggestions? Some Ideas: Internet Explorer, and those that mimic its broken behaviour, require BOTH a time AND a directory (use '/') if you are going to provide a time. Is 15552000 sufficiently in the future to be valid? Use time() + (60*60*24) to be SURE. Or avoid both these issues, and leave out the time argument for now, making it a session cookie, only valid as long as the browser stays open. DEFINITELY configure your browser to let you confirm cookies before accepting them, so you'll know what the cookie is getting sent. Windows XP with Service Pack 2 has made a nightmare out of cookies, by default no longer accepting them -- And I THINK this changes based on your adding that new goofy compact privacy policy header Microsoft made up. It's gotten to the point where I just don't care if IE works or not for the parts of some of my sites that require member login from people who need access, and I don't really care if I lose visitors or not in that particular area. I just tell the users to switch browsers, or live without the access they want. Works so far -- they just switch to a better browser. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I POST data with headers make the browser follow?
The information that comes in from the first page is a creditcard form with the standard values (CCnumber, Expiry Date, Cardholder name etc). On page 2 an XMLrequest is done with a verification gateway (in this case to check for enrolment in 3D-Secure), the result for that I get back on the same page and no redirection needs to be done. However AFTER the enrolment check with the gateway I need to send the user along to the 3rd page, which is a URL that is provided by the verification process. So to get there, as I need to pass a heap of data to that 3rd page I can either use GET or POST, but since the amount of data is fairly big the only real option for this part seems POST. So it's not really about keeping the data persistent, it's more about the fact on how to push the user along correctly. Hope that makes sense somehow. Thanks for the reply. --- Ursprüngliche Nachricht --- Von: Brent Baisley [EMAIL PROTECTED] An: Ragnar [EMAIL PROTECTED] Kopie: php-general@lists.php.net Betreff: Re: [PHP] How do I POST data with headers make the browser follow? Datum: Thu, 6 Oct 2005 08:57:02 -0400 If the information is sensitive, why are you trying to fake a POST submission? A POST can be received from anywhere. SSL is just encrypting it, not verifying the client is the same. I would use session variables to store information you need to access from page to page. That way you can verify that you are talking to the same computer from the first two pages. On Oct 6, 2005, at 5:52 AM, Ragnar wrote: Hi guys/girls, I have to apologize if this issue has been discussed in detail before but I couldn't find anything obvious so far. What I need/want to do is to : 1. Take POST data from a form (no problem) 2. Do whatever i need to on the target page (no problem) 3. Pass some other data on to a 3rd page as a POST request. 4. Get the browser to follow to said 3rd page. All this is happening via SSL. So basically what i am trying to do is to fake whatever happens at a normal POST request that is handled by the browser. Now point 4. in my example above is giving me a massive headache, I have managed to pass data on to the 3rd page as POST quite comfortably using cURL but the browser doesn't follow (ie. the URL in the address bar remains unchanged). I did see that there is a FOLLOWLOCATION option you can set in cURL when you do you request, and though wicked, just what I needed only to find out that it's not working (probably because I understand what it does wrong). Pretty pretty please if anyone knows a solution for the above, let me know. Oh, and I'd also like to add that the information I am trying to get to the 3rd page in the example is sensitive (Credit Card details etc.), so $_GET and $_COOKIE are out of the question. ANY help would be appreciated. Kind regards, Ben -- 5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail +++ GMX - die erste Adresse für Mail, Message, More +++ -- 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 -- 10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail +++ GMX - die erste Adresse für Mail, Message, More +++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP and XML
Yes, I resolved the problem today by installing this RPM via yum. I had assumed it was already installed because I was able to do some XML parsing without it. I was able to get the XML transformed and it looks good, if I do say so myself :) Robbert -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED] Sent: Thursday, October 06, 2005 8:05 AM To: php-general@lists.php.net Subject: RE: [PHP] PHP and XML Quoting Robbert van Andel [EMAIL PROTECTED]: Thanks, I'm investigating XSL and it looks pretty good. We use an RPM based installation of PHP version 5.0.4. I see on PHP.net's website that XSL comes standard with PHP 5 and you need to enable it by adding the argument --with-xsl to the configure line. How do I do this when we did not build PHP from source? Is there another way to get XSL activated? Thanks for your help Robbert You don't mention which distro you're using, but Fedora Core 4 has a php-xml rpm to ...add support to PHP for manipulating XML documents using the DOM tree, and performing XSL transformations on XML documents. Hope this helps, Rick -- Rick Emery When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for there you have been, and there you will always long to return -- Leonardo Da Vinci -- 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] incLomplete
Just saw this error. PHP 5.0.3 Warning: Invalid or inclomplete context in foo.php on line 42 HAHAHAHHAH. inclomplete. :p You had me at EHLO --E.Webb (10.04.05) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP vs. ColdFusion
Quoting Angelo Zanetti [EMAIL PROTECTED]: Please let us know what the outcome is!! A *huge* THANK YOU to everyone who helped me with this (yes, even those who recommended Cold Fusion)! For those interested, our organization has decided (much to my surprise) to go with PHP running on Linux. Thanks again to everyone. Rick -- Rick Emery When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for there you have been, and there you will always long to return -- Leonardo Da Vinci -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Linux/PHP and Windows/MSSQL
Knowing that I'm not the only one to want to connect to Microsoft SQL Server on Windows from PHP and Apache on Linux, I'm seeking advice. I set up a proof-of-concept application, using Gentoo Linux (with which I'm most familiar) as my base. Being a compile-from-source distribution with a lot of packages available, I simply had to set the mssql USE flag and emerge freetds and php. Voila; connectivity. Not surprisingly, now that my organization has decided to go with PHP on Linux, management wants to use a commercially supported distribution (Red Hat or Novell/SUSE). I was surprised to discover that I couldn't find RPMs for freetds, nor could I find php-mssql RPMs, and the php RPMs available in the yum repositories weren't compiled with --with-mssql. Is my only recourse to build freetds and php from source? I'm certainly capable of doing it, but I won't be the server administrator and I think it defeats what management wants to accomplish with a commercially supported distro (package management with easy updates). Is anybody in a similar environment that has an easy solution, or can anybody offer advice? Thanks in advance, Rick -- Rick Emery When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for there you have been, and there you will always long to return -- Leonardo Da Vinci -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP vs. ColdFusion
On Thu, 2005-10-06 at 21:15, Rick Emery wrote: Quoting Angelo Zanetti [EMAIL PROTECTED]: Please let us know what the outcome is!! A *huge* THANK YOU to everyone who helped me with this (yes, even those who recommended Cold Fusion)! For those interested, our organization has decided (much to my surprise) to go with PHP running on Linux. Woot! Management with half a brain :) Gratz! Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Linux/PHP and Windows/MSSQL
There are freetds rpms out there as well as mssql rpms. I got it to work on a Fedora Core 1 box but since upgrading to Fedora Core 4 I was not able to find any rpms for either because they are not available for PHP5 (yet). If you find any I'd love to know. Sorry I can't point to where I got them with the older version of PHP because those notes are at work. Robbert van Andel -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED] Sent: Thursday, October 06, 2005 6:30 PM To: php-general@lists.php.net Subject: [PHP] Linux/PHP and Windows/MSSQL Knowing that I'm not the only one to want to connect to Microsoft SQL Server on Windows from PHP and Apache on Linux, I'm seeking advice. I set up a proof-of-concept application, using Gentoo Linux (with which I'm most familiar) as my base. Being a compile-from-source distribution with a lot of packages available, I simply had to set the mssql USE flag and emerge freetds and php. Voila; connectivity. Not surprisingly, now that my organization has decided to go with PHP on Linux, management wants to use a commercially supported distribution (Red Hat or Novell/SUSE). I was surprised to discover that I couldn't find RPMs for freetds, nor could I find php-mssql RPMs, and the php RPMs available in the yum repositories weren't compiled with --with-mssql. Is my only recourse to build freetds and php from source? I'm certainly capable of doing it, but I won't be the server administrator and I think it defeats what management wants to accomplish with a commercially supported distro (package management with easy updates). Is anybody in a similar environment that has an easy solution, or can anybody offer advice? Thanks in advance, Rick -- Rick Emery When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for there you have been, and there you will always long to return -- Leonardo Da Vinci -- 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] Linux/PHP and Windows/MSSQL
Hi Rick, FreeTDS is still a fast moving target and so is PHP in some areas. Getting pre-compiled RPM's would often force you to run older versions. Compiling from source enables you to keep up to date with the latest features and bug-fixes. If you are running this on multiple computers it's not a big task to copy all files from one test/development box to a number of other systems, as long as the configurations are the same. - Frank Knowing that I'm not the only one to want to connect to Microsoft SQL Server on Windows from PHP and Apache on Linux, I'm seeking advice. I set up a proof-of-concept application, using Gentoo Linux (with which I'm most familiar) as my base. Being a compile-from-source distribution with a lot of packages available, I simply had to set the mssql USE flag and emerge freetds and php. Voila; connectivity. Not surprisingly, now that my organization has decided to go with PHP on Linux, management wants to use a commercially supported distribution (Red Hat or Novell/SUSE). I was surprised to discover that I couldn't find RPMs for freetds, nor could I find php-mssql RPMs, and the php RPMs available in the yum repositories weren't compiled with --with-mssql. Is my only recourse to build freetds and php from source? I'm certainly capable of doing it, but I won't be the server administrator and I think it defeats what management wants to accomplish with a commercially supported distro (package management with easy updates). Is anybody in a similar environment that has an easy solution, or can anybody offer advice? Thanks in advance, Rick -- Rick Emery When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for there you have been, and there you will always long to return -- Leonardo Da Vinci -- 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] Linux/PHP and Windows/MSSQL
On 10/6/05, Rick Emery [EMAIL PROTECTED] wrote: Knowing that I'm not the only one to want to connect to Microsoft SQL Server on Windows from PHP and Apache on Linux, I'm seeking advice. I set up a proof-of-concept application, using Gentoo Linux (with which I'm most familiar) as my base. Being a compile-from-source distribution with a lot of packages available, I simply had to set the mssql USE flag and emerge freetds and php. Voila; connectivity. Not surprisingly, now that my organization has decided to go with PHP on Linux, management wants to use a commercially supported distribution (Red Hat or Novell/SUSE). I was surprised to discover that I couldn't find RPMs for freetds, nor could I find php-mssql RPMs, and the php RPMs available in the yum repositories weren't compiled with --with-mssql. Is my only recourse to build freetds and php from source? I'm certainly capable of doing it, but I won't be the server administrator and I think it defeats what management wants to accomplish with a commercially supported distro (package management with easy updates). Is anybody in a similar environment that has an easy solution, or can anybody offer advice? Being that you are already a Gentoo user you could use Portage to build your RPMs for you. Not positive how to do this as I personally despise RPM but I know it can be done. Check the man pages. It is possible to create RPMs (Redhat package manager files) using Gentoo's Portage, but it is not currently possible to use already existing RPMs to install packages. (from the Gentoo site). -Mike -- Michael E. Crute Software Developer SoftGroup Development Corporation Linux, because reboots are for installing hardware. In a world without walls and fences, who needs windows and gates?
[PHP] Re: How do I POST data with headers make the browser follow?
Message-ID: [EMAIL PROTECTED] To: php-general@lists.php.net Date: Thu, 06 Oct 2005 15:04:41 +0200 From: Petr Smith [EMAIL PROTECTED] Subject: Re: How do I POST data with headers make the browser follow? I have to apologize if this issue has been discussed in detail before but I couldn't find anything obvious so far. What I need/want to do is to : 1. Take POST data from a form (no problem) 2. Do whatever i need to on the target page (no problem) 3. Pass some other data on to a 3rd page as a POST request. 4. Get the browser to follow to said 3rd page. All this is happening via SSL. So basically what i am trying to do is to fake whatever happens at a normal POST request that is handled by the browser. Now point 4. in my example above is giving me a massive headache, I have managed to pass data on to the 3rd page as POST quite comfortably using cURL but the browser doesn't follow (ie. the URL in the address bar remains unchanged). I did see that there is a FOLLOWLOCATION option you can set in cURL when you do you request, and though wicked, just what I needed only to find out that it's not working (probably because I understand what it does wrong). Pretty pretty please if anyone knows a solution for the above, let me know. Oh, and I'd also like to add that the information I am trying to get to the 3rd page in the example is sensitive (Credit Card details etc.), so $_GET and $_COOKIE are out of the question. Hi, it seems you have no understanding how http protocol works.. I can't learn you the whole thing, but I can give you some hints. Read something about HTTP (http://www.digital-web.com/articles/powering_the_web_with_http/), install some network sniffer (ethereal, HttpWatch for IE - great tool for beginners) and see what happens. - you cannot force browser to POST something somewhere with PHP. You have to realize, that PHP is running on server, but the browser is the client. - you cannot use curl to do it. With curl it all happens on the server. If you want to use curl, you have to use same technique used by web based anonymous proxy. Return all loaded data to client, rewrite urls to your script, handle everything correctly until client closes browser. Very complex stuff - followlocation has nothing to do with browser. it only says to curl to evaluate Location header and do auto-redirection - sensitive information? GET, POST, COOKIE, everything could be intercepted - your only help is javascript. You can generate something like this to client browser with php. But you couldn't hide sensitive information this way. body onload=document.forms.myform.submit() form name=myform method=post input type=hidden name=... value=... /form - think about your problem and possible solutions again Petr Hi Petr, thanks for the reply, first off i certainly didn't claim to be an expert on the HTTP, which is why i was asking the question I did. I do realise that PHP runs on the server and can't force the browser to do anything directly, I was merely wondering why header(Location:); got the browser to follow and if there was a way for me to get the same behaiviour working when PHP was posting data. Anyway, I will look at my problem at hand again and will try something else. Thanks for the tips. -- Highspeed-Freiheit. Bei GMX supergünstig, z.B. GMX DSL_Cityflat, DSL-Flatrate für nur 4,99 Euro/Monat* http://www.gmx.net/de/go/dsl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php