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

OmniHTTPd v2.10 and PHP form

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

OmniHTTPd v2.10 and PHP form

Postby ashz » Tue Nov 05, 2002 11:33 pm

Hi,

I am trying to crate a local server on my personal computer and to run a PHP script in it.

I downloaded OmniHTTPd v2.10 for windows and installed it.

The scripts aret:

1MAIN.HTML

<html>
<head>
<title>1</title>
</head>
<body>
<form action="C:\httpd\HtDocs\1.php" method="GET">
<input type="text" name="user">
<input type="submit" value="hit it!">
</form>
</body>
</html>


1.PHP

<html>
<head>
</head>
<body bgcolor="#33ffff" text="#000110" link="#0000ee" alink="#0000ee" vlink="#551a8b">
<?php
print $user ;
?>
</body>
</html>

When I run the 1main.html in netscape 7 I do not get and reponde and the screen do not change.
In IE6 the screen change to the light blue but do not print the user (tried print_r, echo) and put in the address windows the following file:///C:/httpd/HtDocs/1.php?user=aaa.
aaa is the input.

Can any one tell me how can I print the input data from HTML form.

Thx.
ashz
New php-forum User
New php-forum User
 
Posts: 14
Joined: Thu Oct 31, 2002 7:40 am

Postby Jay » Wed Nov 06, 2002 3:35 am

Set the form action to the relative path of the script via URL, not the hard linked path on the server, it won't work like that (it only works in your case because you're using the server as a client).
Last edited by Jay on Thu Nov 07, 2002 3:06 am, edited 1 time in total.
Jay
 

Postby ashz » Wed Nov 06, 2002 5:41 am

Please explain how to do "script via URL"
ashz
New php-forum User
New php-forum User
 
Posts: 14
Joined: Thu Oct 31, 2002 7:40 am

Postby DoppyNL » Wed Nov 06, 2002 5:57 am

post your page to an url, not a file on your hard disk:
so, not like this:
Code: Select all
<form action="C:\httpd\HtDocs\1.php" method="GET">

but like this:
Code: Select all
<form action="1.php" method="GET">

or wherever the file is on the server

Greetz Daan
DoppyNL
 

Postby ashz » Wed Nov 06, 2002 6:54 am

I am using it as a local server.
ashz
New php-forum User
New php-forum User
 
Posts: 14
Joined: Thu Oct 31, 2002 7:40 am

Postby ashz » Wed Nov 06, 2002 7:46 am

Change the line to local server (<form action="http://localhost/1.php" method="GET">) but now I get the following error:
Parse error: parse error, unexpected T_VARIABLE in C:\httpd\HTDOCS\1.php on line 6
ashz
New php-forum User
New php-forum User
 
Posts: 14
Joined: Thu Oct 31, 2002 7:40 am

Postby Jay » Wed Nov 06, 2002 8:26 am

Change print $user to print $_GET['user'];
Jay
 

Postby ashz » Wed Nov 06, 2002 11:35 pm

Thanks for the help.
It works.
ashz
New php-forum User
New php-forum User
 
Posts: 14
Joined: Thu Oct 31, 2002 7:40 am


Return to PHP coding => General

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest

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