Quick Noob Question(s)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
MrNonchalant
Forum Commoner
Posts: 29
Joined: Wed Jul 17, 2002 2:15 am

Quick Noob Question(s)

Post 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.
User avatar
MrNonchalant
Forum Commoner
Posts: 29
Joined: Wed Jul 17, 2002 2:15 am

Post 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.
User avatar
MrNonchalant
Forum Commoner
Posts: 29
Joined: Wed Jul 17, 2002 2:15 am

Post 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...
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post 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
gnu2php
Forum Contributor
Posts: 122
Joined: Thu Jul 11, 2002 2:53 am

Post 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:
User avatar
MrNonchalant
Forum Commoner
Posts: 29
Joined: Wed Jul 17, 2002 2:15 am

Post by MrNonchalant »

Thank you both, though I'm not sure there is Telnet access to my server.
gnu2php
Forum Contributor
Posts: 122
Joined: Thu Jul 11, 2002 2:53 am

Post by gnu2php »

Try:

Code: Select all

print_r(get_loaded_extensions());
User avatar
MrNonchalant
Forum Commoner
Posts: 29
Joined: Wed Jul 17, 2002 2:15 am

Post 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.
User avatar
MrNonchalant
Forum Commoner
Posts: 29
Joined: Wed Jul 17, 2002 2:15 am

Post by MrNonchalant »

I'm taking it no one knows?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

User avatar
MrNonchalant
Forum Commoner
Posts: 29
Joined: Wed Jul 17, 2002 2:15 am

Post 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.
User avatar
MrNonchalant
Forum Commoner
Posts: 29
Joined: Wed Jul 17, 2002 2:15 am

Post 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.
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post 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?
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post 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. :)
User avatar
MrNonchalant
Forum Commoner
Posts: 29
Joined: Wed Jul 17, 2002 2:15 am

Post 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.
Post Reply