Page 1 of 2

Quick Noob Question(s)

Posted: Wed Jul 17, 2002 2:15 am
by MrNonchalant
In writing to a file using the fputs function (alias to fwrite), how could you start it on a new line/use another fuction to add the equivalent of an enter key to the text file? I already tried chr(13) with null success.

Posted: Wed Jul 17, 2002 2:27 am
by MrNonchalant
Ok, another simple one, in the mail function what is the exact syntax with all ints included? The only examples I can find seem to have the bare minimum, I need to include the path to sendmail, and it says you can do that but it told me I had too many ints when I tried adding it.

Posted: Wed Jul 17, 2002 2:29 am
by MrNonchalant
Blah, more questions. Is there any way to find out which libs are compiled in a particular instance of PHP? The standard info dump file seems not to include tht information...

Posted: Wed Jul 17, 2002 2:49 am
by hob_goblin
for the first one..

Code: Select all

\n
is a new line

for instance
if a file looked like

Code: Select all

Hello 
World
you could make that by writing

Code: Select all

<?
echo "Hello\n";
echo "World";
?>
ill get back to you on the other questions

Posted: Wed Jul 17, 2002 2:52 am
by gnu2php
First question--

fputs("\n") should work. If not, you could try fputs("\r\n")


Third question--

You can see the compiled PHP modules by using the -m switch on a command line (I do it from Telnet):

Code: Select all

php.exe -m
Sorry, I don't have an answer to your second question. I'm gnu2php. :lol:

Posted: Wed Jul 17, 2002 6:52 pm
by MrNonchalant
Thank you both, though I'm not sure there is Telnet access to my server.

Posted: Wed Jul 17, 2002 7:10 pm
by gnu2php
Try:

Code: Select all

print_r(get_loaded_extensions());

Posted: Fri Aug 09, 2002 1:52 am
by MrNonchalant
TY to all.

New question: what expire formats work with setcookie on all fairly recent browsers? Fairly recent = NS 4 and up and IE and up. I've tried 'time()+14400" and (at the suggestion of a post on PHP.net) '$time = mktime()+14400;
$date = date("l, d-M-y H:i:s", ($time));.' The first one only works in NS6 and the second doesn't work in NS6 or IE6.

Posted: Sun Aug 11, 2002 2:59 pm
by MrNonchalant
I'm taking it no one knows?

Posted: Sun Aug 11, 2002 3:10 pm
by volka

Posted: Sun Aug 11, 2002 9:33 pm
by MrNonchalant
I already did, there was one that claimed to work, but didn't. I could check more thoroughly, but I've fixed the problem with IE 6.

Posted: Wed Aug 21, 2002 1:28 am
by MrNonchalant
I've found the real problem. At IE6's default security level (medium) it refuses to except my cookie. I was wondering if there are work arounds for this. It lists the restrictions for medium as:

"- Blocks third-party cookies that do not have a compact privacy policy.
- Blocks third-party cookies that use personally identifiable information without your consent.
- Restricts first-party cookies that use personally identifiable information without implicit consent."

I was wondering how IE6 would determine any of this and how I could comply to it accordingly. My cookie stores 4 hex values separated by "|"s and is a part of a color scheme changer for a site.

Posted: Wed Aug 21, 2002 5:10 am
by mikeq
Hi,

My IE6 settings are the same and I don't have any problems accepting cookies.

But anyway 8O WHY don't you just change the settings to Low or add your site to the list of allowable sites, doh 8O

It is unlikely you can override this security, it is called security for a reason.

Here is an example of a cookie that works fine on IE6 with those settings

SetCookie('siteuser',$UserID,time()+15552000);//6 months

this also works in NS4+ IE4+ etc etc

Post your bit of code that does SetCookie. How do you know it doesn't work? what are you doing to check?

Posted: Wed Aug 21, 2002 1:03 pm
by m3mn0n
lol, you ran into all the same problems i did when following my book chapter tp chapter ;)

To get some quick and efficent answers that you can even ask questions about try to use some of the offical php newsgroups. http://www.php.net has a listing of them. Or if you have an IRC client, goto #php or #phphelp on DALnet, some people are really helpful there. :)

Posted: Thu Aug 22, 2002 12:34 am
by MrNonchalant
Thank you both, however I assure you both you were absolutely no help. I posted this on 3 forums and 1 list and the other forum has already answered my question.

mikeq: I think you missed the point(s).

Oromian: Nothing I didn't already know, except for the DaLnet channels. Thanks.