-
will work just like you want.
I don't mean to butt in, but I used to do the same thing Bluewalrus. I think it starts because a lot of the time you are doing things like:
Code:
<?php echo '<p class="class"><a href="/">text</a></p>' . "\n"; ?>
And in this case you would have to concatenate the \n because the single quotes are gonna print the literal \n if you don't. So depending on what you are echoing, sometimes you must concatenate, and sometimes you don't have to. It took me a while to get the hang of using single or double quotes, because like you, I like to find one way of doing something that works and stick to it.
-
Thanks so much Chris. I will try this tonight and see what happens!!!
-
PHP Code:
$sendata="Email Address to respond to:". $visitormail;
$q="Comment from ". $visitor . " ". $notes . "Submitted:" . $todayis ;
I mean like that.. When your using double quotes - don't use conatenation... Unless there is a specific reason. Such as:
Code:
<?php
$var = "Hello";
$Hello = "GoodBye";
echo $$var;
?>
-
A few things Chris,
Does this just send the message to an email? or does it post to that page so anyone can see the message?
The 3 sections of code you laid out, should each of those be php files?
Also, how do I set permissions to the txt file, which is empty right?
Thanks dude
-
If your in your ftp right click, or apple click, or ctrl click, and then look for something like file attributes (in filezilla), properties, permissions maybe and click it then there should be a bunch of check boxes containing owner, group and public you can either check of all those or type in 777 in the text area at the bottom. It can email you when a new post has been set if you want it to that line is commented out in the code I gave you if you delete that comment it will email you. The 2 sections need to be php, the form one doesn't need to be but can be if you want, if you want to log ip addresses you'll need it to be php. Let me know what ftp you using if the finding the permissions above didn't help.
-
-
ok Chris,
So I put the small bit of php code in the div tags in "guests.php", I put the form in the html file, and I put the large bit of php code in guest_book.php. The txt has all permissions set to it.
You can see the page here
Here are the warnings I get! I was bound to get warnings on my first try!
Warning: fopen(guestbook.txt) [function.fopen]: failed to open stream: Permission denied in D:\Hosting\3030954\html\HeadFirstGraphics\ourwedding\Chrisguestbook\guest_book.php on line 52
Warning: fwrite(): supplied argument is not a valid stream resource in D:\Hosting\3030954\html\HeadFirstGraphics\ourwedding\Chrisguestbook\guest_book.php on line 57
Warning: fclose(): supplied argument is not a valid stream resource in D:\Hosting\3030954\html\HeadFirstGraphics\ourwedding\Chrisguestbook\guest_book.php on line 59
-
What are your permissions saying, 777? The other error's are from the text file not being able to open
-
Run this:
Code:
echo fileperms('guestbook.txt');
(and I'll do something to figure out the type), or run this:
Code:
echo substr(decoct(fileperms("thanks.php")),3);
-
right the first txt I had wasn't actually a txt file. So I uploaded a new txt file and right clicked. When I do I click on get info and I am able to see properties and permissions. Right now the permissions are 644, and when I go and change them to 777 and hit apply I get an error message.
My server is windows through godaddy and the ftp is transmit
Thanks
Will