Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Help me please...I am newbie for PHP...
Old 05-12-2005, 12:32 PM Help me please...I am newbie for PHP...
Novice Talker

Posts: 10
Trades: 0
Dear Expert,

I just installed PHP 5.0.4 into my Windows XP Pro using Installer...After all, I tried to test a simple statement as follow:

First, I created my HTML page called "test.html" and do these following codes:

<html>
<body>

<form action="welcome.php" method="POST">
Enter your name: <input type="text" name="name" />
Enter your age: <input type="text" name="age" />
<input type="submit" />
</form>

</body>
</html>

Secondly, I created "welcome.php" and put these following codes:

<html>
<body>

Welcome <?php echo $_POST["name"]; ?>.<br />
You are <?php echo $_POST["age"]; ?> years old!

</body>
</html>

When I click "Submit" button it should come out like this:

Welcome John.
You are 28 years old!

as I put name: John and year: 28....However, in fact, when I click submit button it still appear like this:

<html>
<body>

Welcome <?php echo $_POST["name"]; ?>.<br />
You are <?php echo $_POST["age"]; ?> years old!

</body>
</html>

same as the code...What happen with this..???..what's wrong with this..???..Anyone could help me to solve this problem please..???..in order my HTML and PHP can work together..??

Thank you very much for your HELP and ASSISTANCE...

Best Regards,

Stephanie
zach007 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-12-2005, 12:57 PM
merlin's Avatar
Skilled Talker

Posts: 52
Trades: 0
It looks like you're missing the "What to do" if you click submit.

Try This,

PHP Code:
<?php
if (isset($_POST['submit'])) {
          echo 
'<p>Welcome {$_POST['name']} </p>';<br />
          echo 
'<p>You are {$_POST['age']}  years old!</p>';
}
?>
__________________
No more yankey my wankey, the Donger need food!

Last edited by merlin; 05-12-2005 at 01:07 PM..
merlin is offline
Reply With Quote
View Public Profile
 
Old 05-12-2005, 01:12 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
PHP isn't parsing the .php pages.

Check the application mappings and make sure that .php is mapped to c:\php\php.exe
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-12-2005, 03:39 PM
merlin's Avatar
Skilled Talker

Posts: 52
Trades: 0
Or, that could also work
__________________
No more yankey my wankey, the Donger need food!
merlin is offline
Reply With Quote
View Public Profile
 
Old 05-12-2005, 07:35 PM
Novice Talker

Posts: 10
Trades: 0
Thanks for all your reply. However, I had already tried what Merlin suggest but still doesnt work....And, Chris...about mapping idea, honestly after I read trough...I really have no idea what to do.....Would you please give me a walktrough about what to do in order can test my PHP page please..????..instead of reading the link that you gave (because I really have no idea about that)..and the most important to know is, when I was installing PHP using installer for windows, I did not set to IIS...I set to configure manually....Because I dont know what to do about that....I really really need your help please...

Thanks very much for your kind help and assistance.

Stephanie
zach007 is offline
Reply With Quote
View Public Profile
 
Old 05-13-2005, 07:02 AM
scottfree's Avatar
Extreme Talker

Posts: 234
Location: Hamburg
Trades: 0
Well, I tested the code on my machine and it works fine exactly how you had it in the beginning. It must be a problem with your php installation. I would say try uninstalling it and reinstalling or try to download Xammp which is apache, mysql, php, everything all in one and really easy to install. You will find it at www.apachefriends.org
Good luck.
__________________
I think, therefore I am..... I think.
scottfree is offline
Reply With Quote
View Public Profile Visit scottfree's homepage!
 
Old 05-13-2005, 01:45 PM
Novice Talker

Posts: 10
Trades: 0
Thanks for your guidance...However, I have already installed XAMPP...Now, what should I do in order my PHP files can be readed please..???..Please let me know how/walktrough, because I have no idea about this XAMPP...

Thanks very much for your kind helps...

Stephanie
zach007 is offline
Reply With Quote
View Public Profile
 
Old 05-14-2005, 08:37 AM
scottfree's Avatar
Extreme Talker

Posts: 234
Location: Hamburg
Trades: 0
OK, if you´ve installed xampp with the windows installation, you should have a directory C:\xampp. Now, in that directory, you have a file named "xampp_start.exe". Double click this (easier to create a shortcut somewhere) and an msdos window opens and starts Apache, MySQL etc. Don´t close this window or Apache stops!
Now open your browser and type in "http://localhost/" You should get a page to choose your language, click english and you should get a Welcome page for XAMPP. Congratulations, you have installed the server correctly! If this doesn´t work, try uninstalling xampp and reinstalling it and note where it´s installed.
If it is working you should have some links on the left, click on "phpinfo()" and you should get a page showing all your php setting etc. Congratulations, php works on your machine!
Now, all your www documents are, by default, run from the "C:\xampp\htdocs" folder. You can create a folder there called "test" or whatever. Now put the "test.html" and "welcome.php" files in the test folder.
Now go to your browser and type in "http://localhost/test/test.html" and you should see the page. Fill in the info and submit. It should work now.
Good luck.
Let me know what happened.
__________________
I think, therefore I am..... I think.
scottfree is offline
Reply With Quote
View Public Profile Visit scottfree's homepage!
 
Old 05-14-2005, 09:07 AM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
The problem is that Apache is not recognizing php files as belonging to the php binary. I believe in your apache directory, under the folder confs there should be a file called httpd.conf. You should find something similiar to this in that file...

LoadModule php5_module "c:/xamp/php/sapi/php5apache2.dll"

Directly underneath it add this...

AddType application/x-httpd-php .php

I believe that should do the trick (after you restart apache).
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 05-14-2005, 12:15 PM
Novice Talker

Posts: 10
Trades: 0
Hi,

When I already create a folder called "Test" at "htdocs" folder. However, when I try to load my "test.html" to create output "welcome.php", it shown like this error message:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in F:\XAMPP\apachefriends\xampp\htdocs\Test\welcome.p hp on line 6

So, what should I do then....

I attach my test.html and welcome.php as TXT files for your consideration.


Thanks,

Stephanie
Attached Files
File Type: txt welcome.txt (207 Bytes, 8 views)
File Type: txt test.txt (215 Bytes, 7 views)
zach007 is offline
Reply With Quote
View Public Profile
 
Old 05-14-2005, 01:07 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the <br /> is outside the ;
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-14-2005, 07:27 PM
scottfree's Avatar
Extreme Talker

Posts: 234
Location: Hamburg
Trades: 0
Yeah, chrishirst is right, it should read "echo '<p>Welcome {$_POST['name']} </p><br />';"
__________________
I think, therefore I am..... I think.
scottfree is offline
Reply With Quote
View Public Profile Visit scottfree's homepage!
 
Old 05-14-2005, 09:35 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
whats with the {}'s around your variables?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 05-14-2005, 10:15 PM
Novice Talker

Posts: 10
Trades: 0
Hi, Thanks for your reply...however, it wont works...still error...Any other hints please...???
zach007 is offline
Reply With Quote
View Public Profile
 
Old 05-16-2005, 09:30 PM
Novice Talker

Posts: 10
Trades: 0
help me please..???
zach007 is offline
Reply With Quote
View Public Profile
 
Old 05-16-2005, 09:35 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Quote:
Originally Posted by cptnwinky
whats with the {}'s around your variables?
????
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 05-17-2005, 12:48 AM
Novice Talker

Posts: 10
Trades: 0
Hi,

I dont understand what are you talking about..???
zach007 is offline
Reply With Quote
View Public Profile
 
Old 05-17-2005, 01:03 AM
Uche's Avatar
Extreme Talker

Posts: 174
Location: Nigeria/Lagos
Trades: 0
Don't post twice pls
__________________
Life is just lyke a school where everybody goes to learn one or two thing. the more u school, the more u learn more about school..The more we live our lifes.. the more we learn more about life.

Please login or register to view this content. Registration is FREE
Uche is offline
Reply With Quote
View Public Profile Visit Uche's homepage!
 
Old 05-17-2005, 03:10 AM
Novice Talker

Posts: 10
Trades: 0
Hi, I did not post twice...I just need helps BUT no one answers my questions....
zach007 is offline
Reply With Quote
View Public Profile
 
Old 05-17-2005, 03:21 AM
OmuCuSucu's Avatar
Vi Veri Veniversum Vivus

Posts: 1,168
Name: Dragos-Valentin
Location: Cluj-Napoca, RO
Trades: 0
zach007,

i would say uninstall everything, go to http://apache2triad.net , download the latest build, install it and try it.

it's pretty much the same, the difference is that i never had any problems with it.

it will be pretty much the same as xampp, it will install in c:\apache2triad if you don't specify otherwise, and your pages will be in c:\apache2triad\htdocs\ ... if that doesn't work eighter i really wouldn't know what to say.
__________________
.
» Please remember to add to my Talkupation if you enjoyed my post. Thank you :)
.
OmuCuSucu is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help me please...I am newbie for PHP...

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.54485 seconds with 13 queries