RE: [PHP] HTML file to a $var: Pls Help
There is another way to do this... ob_start(); readfile($file); $var = ob_get_contents(); ob_end_clean(); If you want to parse the file as PHP before inputting it into the variable, instead of using readfile() use this: eval("require(\"".$file."\");"); == eNetwizard Network http://www.enetwizard.net/default.ehtml == eNetwizard Content Management Server http://project.enetwizard.net/cmserver.ehtml == eNetwizard Managed Hosting Services http://hosting.enetwizard.net/hosting.ehtml == -Original Message- From: @ Edwin [mailto:copperwalls@;hotmail.com] Sent: Friday, October 25, 2002 11:06 PM To: Shane Cc: [EMAIL PROTECTED] Subject: Re: [PHP] HTML file to a $var: Pls Help Hello, "Shane" <[EMAIL PROTECTED]> wrote: > Any way to plug an entire HTML file into a variable? > > I looked into file_get_contents() but that was CVS format only. > True. But you can make your own. Something like this: ---> function file_get_contents($filename) { $fp = @fopen($filename, "r"); if (!($fp)) { return 0; } while (!feof($fp)) { $temp .= fread($fp, 4096); } return $temp; } That was from the manual: http://www.php.net/manual/en/function.file-get-contents.php Also, always check the "User Contributed Notes" for some good tips :) HTH, - E -- 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] Referral Site...
$HTTP_REFERER $_SERVER["HTTP_REFERER"] Samuel | http://enetwizard.net -Original Message- From: Ken Kirtley [mailto:kdkirtley@;earthlink.net] Sent: Saturday, October 26, 2002 5:47 PM To: [EMAIL PROTECTED] Subject: [PHP] Referral Site... I'm new to PHP and so this may be something of a newbie question. My bad if it is. I've spent a week now looking for information on capturing the referral site with php so that I can store it with some session information. If any of you have any idea how to accomplish this I would greatly appreciate any information. Thanks in advance...Ken -- 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] Trouble with switch statements
Use $_GET["select"] for the switch statement Some of the people on this list would even recommend you make another variable first, such as $userselect = $_GET["select"] and use $userselect as your switch statement, though I think it pointless. Or turn register_globals on in the php.ini file (not recommended) -Samuel | http://enetwizard.net -Original Message- From: Edward Kehoe [mailto:emkehoe@;learn.senecac.on.ca] Sent: Friday, October 25, 2002 1:47 PM To: [EMAIL PROTECTED] Subject: [PHP] Trouble with switch statements Ok...I just recently installed Apache1 and PHP 4.2.3 on my computer and I've configured everything. However, I can't seem to get my switch statements to accept variable values from the address bar. So if I type in: http://www.my-site.com/index.php?select=1 It displays the text in the default part of the switch statement. I also seem to get the following error message every time: Notice: Undefined variable: select in c:\apache\apache\htdocs\index.php on line 51 Here's the code for my switch statement as well: switch($select) { case 1: print "About Stuff Goes Here."; break; case 2: print "Music Goes Here."; break; default:print "Testing..."; break; } -- 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] standardization across apps?
XML, by definition is an eXtensible Markup Language. That means the markup associated with a document can be whatever that person wants it to be. I think a better question to ask is if there are any projects out there who are working toward a standard XML document type for contact information, and there probably is. However, I don't believe that the many CMS' (including my own), forums, link directories, etc., would ever be able to use a unified package (and especially not a unified user manager). Each CMS has its own way of dealing with content and how that content is managed; it is all proprietary to that particular system. I do think, however, it should be possible to convert from one CMS to another, and in fact, there are some members of my team who want to create a phpnuke-to-enetwizard and vice versa utility for doing things like that. And I think that with time one will exist. But getting others to adopt such an idea would probably be difficult, since they want you to use their software. :) -Samuel | http://enetwizard.net -Original Message- From: taylor [mailto:taylor@;justaddfire.com] Sent: Tuesday, October 29, 2002 12:14 AM To: [EMAIL PROTECTED] Subject: [PHP] standardization across apps? i might be crazy, but why don't the many CMS, forum, link directory, etc packages integrate with a unified user manager? is this possible? is there perhaps an xml standard for contact datatypes that could be used? -- 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