We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
  • Pages:
  • 1
A little problem; should be easy to solve
Topic Started: May 2 2005, 10:51 AM (638 Views)
Gimliisadwarf
Member Avatar
Member
[ * ]
I am using www.maddog.com and tripod to try fool around with php.. but for some reason i have no idea to even start typing.. i am used to freewebs where i just copy and paste my html files into a space... well yea i am lost with these two hosts...
I am using the free versions.. of both tripod and maddog.

Thanks allot
Offline Profile Quote Post Goto Top
 
Jory
Member Avatar
Member
[ *  *  *  *  *  * ]
Huh?
So you don't know where to start typing?
Well, just get yourself an editor, type the code into there and upload the files.


However, if its just for testing, I recommend just getting yourself a program that lets you use the php on your pc.

I use dreamweaver (editor) phpdev (for php on your own pc) and ftpvoyager (uploading) but that really doesn't mather.

I hope this helps, if not could you rephraze the question?
Offline Profile Quote Post Goto Top
 
Gimliisadwarf
Member Avatar
Member
[ * ]
Well you know on freewebs you can just go to site managar create a page and edit it?? well i cant seem to find out how to do that....

Thanks
Offline Profile Quote Post Goto Top
 
Rory
Member Avatar
i;m a mess
[ *  *  *  *  *  *  * ]
There is probably instructions on how to FTP files to your space. I know the UK version of tripod used to use FTP, so i'm assuming other countries do as well.
Offline Profile Quote Post Goto Top
 
Gimliisadwarf
Member Avatar
Member
[ * ]
hmm i think i got it to work.. dont know why but the php doesnt seem to work on it.. i have no idea why it just doesnt.. i know the codes are right so i dont know whats wrong.. i cant find any tutorials either :(
Offline Profile Quote Post Goto Top
 
Jory
Member Avatar
Member
[ *  *  *  *  *  * ]
Could you post the code anyway? :/
Did you save it as a .php file?
Offline Profile Quote Post Goto Top
 
Gimliisadwarf
Member Avatar
Member
[ * ]
yea i did it on notepad i uploaded it onto the server.

well this is what i did first
Code:
 
<html>
<title>Php testings</title>
<body>
<?php

$FavoriteColor = "green";



if ($FavoriteColor == "blue") {

print ("I like blue too!");

} elseif ($FavoriteColor = green) {

print ("MMMmmmmmmmmmm, green!");

}

?>
</body>
</html>

That didnt work so i tried to do the most basic thing i could think of

Code:
 

<html>
<body>

 <?php

 print ("I am the CHICKEN MAN");

 ?>

</body>
</html>

that should have worked but it didnt... oh by the way i did it on notepad saved it as Php testing.php and uploaded it onto the server.. on the server it changed to .php.txt i left one document like that and the exact same document i renamed to only .php dont know if that helps..

Offline Profile Quote Post Goto Top
 
Das
Member Avatar
Smells of rich mahogany
[ *  *  *  *  *  *  * ]
Gimliisadwarf
May 3, 2005 07:41 AM
Code:
 
<html>
<title>Php testings</title>
<body>
<?php

$FavoriteColor = "green";



if ($FavoriteColor == "blue") {

print ("I like blue too!");

} elseif ($FavoriteColor = green) {

print ("MMMmmmmmmmmmm, green!");

}

?>
</body>
</html>




Code:
 

<html>
<body>

 <?php

 print ("I am the CHICKEN MAN");

 ?>

</body>
</html>

that should have worked but it didnt... oh by the way i did it on notepad saved it as Php testing.php and uploaded it onto the server.. on the server it changed to .php.txt i left one document like that and the exact same document i renamed to only .php dont know if that helps..

The first code will always return the second choice. You set up $favoritecolor as a constant variable. The reason it isn't working is you are confusing javascript and php.

Javascript: print("Text")
PHP: echo "text"
Offline Profile Quote Post Goto Top
 
Gimliisadwarf
Member Avatar
Member
[ * ]
Huh how could it be wrong.. lol i got this stuff from a php tutorial:P... lol geuss i shouldnt use webmonkey.. i will try it out then thanks.. the tutorial said either echo or print would work.. geuss not
Offline Profile Quote Post Goto Top
 
Gimliisadwarf
Member Avatar
Member
[ * ]
hmm no i changed all of that to.. i still have the same problem
Offline Profile Quote Post Goto Top
 
Jory
Member Avatar
Member
[ *  *  *  *  *  * ]
try saving it like this:
File >> Save As >> Save as type (All types) >> something.php

(If you did not do Save as type (All types) windows might make it something.php.txt but you don't see it because you most likely have set it so that fileformats it knows have the extention hidden (why the **** did they make that the default option :@ ) )

tip:
don't use CAPS in variable names, it will haunt you for the rest of the time you use the file :ph34r:


edit:
btw, you should edit your posts.
(just click on the button next to your post that looks like
Posted Image :yes: )
Offline Profile Quote Post Goto Top
 
solinent
Member Avatar
Member
[ *  *  * ]
actually both print() and echo() functions are valid in php.

just that echo is used more often as it's shorter and doesn't requre the function braces ;)
Offline Profile Quote Post Goto Top
 
Das
Member Avatar
Smells of rich mahogany
[ *  *  *  *  *  *  * ]
solinent
May 3, 2005 08:58 AM
actually both print() and echo() functions are valid in php.

just that echo is used more often as it's shorter and doesn't requre the function braces ;)

:$ Sorry
Offline Profile Quote Post Goto Top
 
solinent
Member Avatar
Member
[ *  *  * ]
It's ok..I bow down to you, you have like 2.8k posts lol :) and I'm only 13 lol :S
Offline Profile Quote Post Goto Top
 
Das
Member Avatar
Smells of rich mahogany
[ *  *  *  *  *  *  * ]
solinent
May 3, 2005 06:29 PM
It's ok..I bow down to you, you have like 2.8k posts lol :) and I'm only 13 lol :S

~2.4 :P I am only 13 aswell.

Quote:
 
Huh how could it be wrong.. lol i got this stuff from a php tutorial :P... lol geuss i shouldnt use webmonkey.. i will try it out then thanks.. the tutorial said either echo or print would work.. geuss not

tecvhnically it does work, but since you defined you variable as a constant there is no way to change it to say or print the else statement.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Technology Chat · Next Topic »
Add Reply
  • Pages:
  • 1