Quick Noob Question(s)
Moderator: General Moderators
- MrNonchalant
- Forum Commoner
- Posts: 29
- Joined: Wed Jul 17, 2002 2:15 am
Quick Noob Question(s)
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.
- MrNonchalant
- Forum Commoner
- Posts: 29
- Joined: Wed Jul 17, 2002 2:15 am
- MrNonchalant
- Forum Commoner
- Posts: 29
- Joined: Wed Jul 17, 2002 2:15 am
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
for the first one..
is a new line
for instance
if a file looked like
you could make that by writing
ill get back to you on the other questions
Code: Select all
\nfor instance
if a file looked like
Code: Select all
Hello
WorldCode: Select all
<?
echo "Hello\n";
echo "World";
?>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):
Sorry, I don't have an answer to your second question. I'm gnu2php. 
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- MrNonchalant
- Forum Commoner
- Posts: 29
- Joined: Wed Jul 17, 2002 2:15 am
Try:
Code: Select all
print_r(get_loaded_extensions());- MrNonchalant
- Forum Commoner
- Posts: 29
- Joined: Wed Jul 17, 2002 2:15 am
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.
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.
- MrNonchalant
- Forum Commoner
- Posts: 29
- Joined: Wed Jul 17, 2002 2:15 am
you should read the user contributed notes on setcookie
- MrNonchalant
- Forum Commoner
- Posts: 29
- Joined: Wed Jul 17, 2002 2:15 am
- MrNonchalant
- Forum Commoner
- Posts: 29
- Joined: Wed Jul 17, 2002 2:15 am
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.
"- 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.
Hi,
My IE6 settings are the same and I don't have any problems accepting cookies.
But anyway
WHY don't you just change the settings to Low or add your site to the list of allowable sites, doh
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?
My IE6 settings are the same and I don't have any problems accepting cookies.
But anyway
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?
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.
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.
- MrNonchalant
- Forum Commoner
- Posts: 29
- Joined: Wed Jul 17, 2002 2:15 am