| View previous topic :: View next topic |
| Author |
Message |
Localhost I post too much
Reputation: 0
Joined: 28 Apr 2007 Posts: 3402
|
Posted: Wed Jul 09, 2008 2:48 pm Post subject: [PHP TUT] Beginners Tutorial [UPDATE] |
|
|
~END~ _________________
Last edited by Localhost on Sat Jul 12, 2008 3:21 pm; edited 2 times in total |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Wed Jul 09, 2008 8:04 pm Post subject: |
|
|
Thanks I always wanted to learn PHP. Can't wait for more of your tutorials. _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Orbit Advanced Cheater
Reputation: 0
Joined: 09 Dec 2007 Posts: 74
|
Posted: Wed Jul 09, 2008 8:25 pm Post subject: |
|
|
Do u type all this in notepad?
and then how to you host it? |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Thu Jul 10, 2008 12:48 am Post subject: |
|
|
| GhostK!ller7 wrote: | Do u type all this in notepad?
and then how to you host it? |
He stated in the top part of the tutorial about the hosting.
| Quote: | Unlike HTML, you CANNOT just open this with FireFox.
You will need to upload it to the host like ( http://www.x10hosting.com/ ) or something similar! |
_________________
- Retired. |
|
| Back to top |
|
 |
Localhost I post too much
Reputation: 0
Joined: 28 Apr 2007 Posts: 3402
|
Posted: Thu Jul 10, 2008 8:36 am Post subject: |
|
|
First you right it in notepad, then you click "Save As" then file.php or whatever you want...
Usuall in Windows you have to do an extra step... i forget what it is... you want an index.php file... not an index.php.txt file  _________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 10, 2008 9:05 am Post subject: |
|
|
Whats the difference between ' ' and " "? _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Localhost I post too much
Reputation: 0
Joined: 28 Apr 2007 Posts: 3402
|
Posted: Thu Jul 10, 2008 9:16 am Post subject: |
|
|
To be completely serious, i do not know the difference, but in most cases they are interchangeable... and for good reasons too...
you can do echo "John said "hey""; so you could do echo "John said 'hey'"; to correct it... so basically what im trying to say, you cant open another " quote " before you close the first one! _________________
|
|
| Back to top |
|
 |
thephoneguy Grandmaster Cheater
Reputation: 1
Joined: 17 Mar 2007 Posts: 873
|
Posted: Thu Jul 10, 2008 11:12 am Post subject: |
|
|
do me a favor. if theres no differences than try to put a variable in a ' ' single line quote mark (dont know the name lol ) it will have no effect
only use " if you are doing something more than simply outputting text. otherwise your page load times will be slower. that is how it was explained to me. look in my sticky for phpvideotutorials.com or something like that a great place to start for php _________________
If you see me posting referring to an earlier conversation 9/10 times it was in the chatbox at baby .
 |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Thu Jul 10, 2008 12:27 pm Post subject: |
|
|
You achieve the same effect using " " vs. ' ', except that if you use " " to embrace a full string, you cannot freely use them in the string as well. You will have to 'escape' them first. For example:
| Code: | | $string = "This would cause an error since I have " in the middle of the sentence."; |
The correct way to write that would be:
| Code: | | $string = "This will not cause and error having \" in the middle of the sentence."; |
But, if you use ' ' to embrace the main string, you can use " freely. For example:
| Code: | | $string = 'This is my string using " within the sentence freely.'; |
Keep in mind this works in the reverse as well. If you embrace a string using a single quote, you cannot use a single quote in the sentence freely. You will need to escape it as well. _________________
- Retired. |
|
| Back to top |
|
 |
Localhost I post too much
Reputation: 0
Joined: 28 Apr 2007 Posts: 3402
|
Posted: Thu Jul 10, 2008 3:45 pm Post subject: |
|
|
Next i will post some things about MySQL and PHP. _________________
|
|
| Back to top |
|
 |
thephoneguy Grandmaster Cheater
Reputation: 1
Joined: 17 Mar 2007 Posts: 873
|
Posted: Fri Jul 11, 2008 3:37 am Post subject: |
|
|
| Wiccaan wrote: | You achieve the same effect using " " vs. ' ', except that if you use " " to embrace a full string, you cannot freely use them in the string as well. You will have to 'escape' them first. For example:
| Code: | | $string = "This would cause an error since I have " in the middle of the sentence."; |
The correct way to write that would be:
| Code: | | $string = "This will not cause and error having \" in the middle of the sentence."; |
But, if you use ' ' to embrace the main string, you can use " freely. For example:
| Code: | | $string = 'This is my string using " within the sentence freely.'; |
Keep in mind this works in the reverse as well. If you embrace a string using a single quote, you cannot use a single quote in the sentence freely. You will need to escape it as well. |
| Code: |
<?php
$dog = 'i told you so';
echo "$dog"."<br />";
echo '$dog';
?>
|
just run it and you will see what i was talking about. _________________
If you see me posting referring to an earlier conversation 9/10 times it was in the chatbox at baby .
 |
|
| Back to top |
|
 |
|