Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Problem: Compiling PHP on local PC

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Problem: Compiling PHP on local PC

Postby alsaffar » Wed Aug 14, 2002 12:14 pm

Hi there,

My problem can be solved only by those who're compiling their scripts on their local PC.

I'm using:

Apache 2.0.4
PHP 4.2.2
MySQL 3.23.51
OS: Windows XP Pro

I just started compiling my php scripts on my local PC instead of uploading them and testing them on the web. The restreiving from my tables is fine but the insertion is not.

These are a test files:

1. test.html :

<FORM NAME=Registration ACTION="test.php" METHOD="POST">
<input type="text" name="signUserName" size="30">
<input type="password" name="signPassword" size="30">
</FORM>

2. test.php :

<?php
Print "<HTML><BODY>";
Print "UserName: $signUserName<BR>";
Print "Password: $signPassword<BR>";
Print "</BODY></HTML>";
?>

When I executed the test.html from my local PC, it went to the php file and showed nothing but:

UserName:
Password:

The values in the text boxes didn't moved from the html file to the php files, but when I teseted these scripts when I uploaded them, and they are working fine!

What is wrong? What I'm missing?

Another question; Can use cookies in my local PC when I'm not connected to the internet using only Apache? And what about the script if it has to send mail?

Please for any clarification you can reply here or send me an email.

Ali

ali_alsaffar@hotmail.com
alsaffar
New php-forum User
New php-forum User
 
Posts: 4
Joined: Wed Aug 14, 2002 11:49 am

Re: Problem: Compiling PHP on local PC

Postby Jay » Wed Aug 14, 2002 1:26 pm

Try
Code: Select all
<?php
Print "<HTML><BODY>";
Print "UserName: ".$_POST['signUserName']."<BR>";
Print "Password: ".$_POST['signPassword']."<BR>";
Print "</BODY></HTML>";
?>

Read up on Super Global Arrays to find out what you're missing!

The script will send mail if you set up your mail server address correctly. And you can use cookies on your local PC, but they'll only be effective on your local PC!
Jay
 

Re: Problem: Compiling PHP on local PC

Postby WiZARD » Wed Aug 14, 2002 11:07 pm

In a future try use like this:
Code: Select all
<HTML><BODY>
UserName: <? echo ($signUserName) ?><BR>
Password: <?echo ($signPassword) ?><BR>
</BODY></HTML>


this code faster....
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

Re: Problem: Compiling PHP on local PC

Postby DoppyNL » Wed Aug 14, 2002 11:48 pm

WiZARD wrote:In a future try use like this:
Code: Select all
<HTML><BODY>
UserName: <? echo ($signUserName) ?><BR>
Password: <?echo ($signPassword) ?><BR>
</BODY></HTML>

this code faster....


Code: Select all
<HTML><BODY>
UserName: <?php=$signUserName?><BR>
Password: <?php=$signPassword?><BR>
</BODY></HTML>


My best guess is that this would be even faster following you're reasoning.

allthough my experience is that there is almost no noticeable speed-difference. I tend to look at readability of the code, if the code would become VERY unreadable for the programmer, then something has to be done about it. It's not only the speed of the script running that counts, also the speed in wich the programmer can modify the script in the future.

Greetz Daan
DoppyNL
 


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 4 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron