 |
| Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 25th, 2003, 09:22 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Run a signin script to sign a guestbook
I have been trying for myself to create a guestbook but i
haven't got some experience with web programming.
I have downloaded .the program PHP Coder Pro
I have created the files sign.php, dbconnect.php and a create_entry.php
When i want to run my sign.php form and i click on the button sign then i get a message file download, do wou want to save, open or cancel the file create_entry.php
Is this normal because afterwards i can't open create_entry.php
and my data which i filled in on my sign.php form isn't in the database either.
Can you help me ??
Thx
|
|

June 25th, 2003, 11:38 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
have you written any of the php yourself or does this program do it for you?
----------------------------
Oh happyland!
|
|

June 26th, 2003, 02:09 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I've took some examples together and started with that,
that program just gives some more color to make my program more clear.
This is my code from the file sign.php :
<h2>Sign my guest book!!</h2>
<form method=post action="C:\PHP\apache\htdocs\create_entry.php">
<b>Naam :</b>
<input type=text size=40 name=name>
<br>
<b>Locatie :</b>
<input type=text size=40 name=location>
<br>
<b>Email :</b>
<input type=text size=40 name=email>
<br>
<b>Home page URL :</b>
<input type=text size=40 name=url>
<br>
<b>Commentaar :</b>
<textarea name=comments cols=40 rows=4 wrap=virtual></textarea>
<br>
<input type=submit name=submit value="Sign!">
<input type=reset name=reset value="Start over">
</form>
|
|

June 26th, 2003, 01:16 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
are you running on a windows server?
----------------------------
Oh happyland!
|
|

June 27th, 2003, 07:10 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No, i downloaded apache 1.3.14
When i run the application and i select a link then PHP asks me to open or save.
When i open the file, nothing happens. But when i refresh then i go to the next screen as it needs to be but my program haven't made the changes i requested in the database.
|
|

June 29th, 2003, 05:04 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i'm confused, do you mean some kind of text editor is having problems opening your files, or does your script not work?
----------------------------
Oh happyland!
|
|

July 1st, 2003, 04:43 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by natmaster
are you running on a windows server?
Quote:
quote:
Quote:
quote:
<form method=post action="C:\PHP\apache\htdocs\create_entry.php">
|
|
Yes, he's running on a WierdOS server: an Apache WierdOS server, but a WierdOS server, nonetheless :).
FWIW, the form action should be a path your webserver understands, (i.e. just "create_entry.php", in this case, not a physical path that runs from the root of your hard drive ;) ).
Dan
----------------------------
Oh happyland!
|
|
|

July 1st, 2003, 12:35 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
yeah, that's what i was trying to get at Dan, i was thinking that speedy might be having access problems but i just got confused :P.
what it is doing speedy, is sending you to a file location for download, rather than redirecting to another http page. if you use the C:\... than your protocol will change
----------------------------
http://aod.genesismuds.com
|
|

July 2nd, 2003, 06:50 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sorry but now i'm confused.
In the beginning i used the file create_entry.php without the fysical directory but nothing happened afterwards.
Then i used the directory but this ran not as i hoped.
I use the PHP Coder from www.phpide.de, i think i'll better search for a manual about this development environment.
|
|

July 2nd, 2003, 08:54 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Well, in that case, your problem must lie in your create_entry.php file, not the file you are POSTing the values from: nothing happened because of a fault in the page that was recieving the values from the form. The problem about being asked to download the create_entry.php file, rather than simply running it, is secondary to your original problem, and has been caused by specifying the physical path to the PHP file, rather than a path relative to the Apache server's web-root directory. Unless the file is requested from somewhere on the webserver's web-directory structure a server-side scripted file (of any type, on any webserver I know of - be it PHP, ASP, CFMX, or whathaveyou) will not be run through the webserver's scripting language interpreter, but will instead be offered as-is.
Dan
Quote:
quote:Originally posted by speedyH
Sorry but now i'm confused.
In the beginning i used the file create_entry.php without the fysical directory but nothing happened afterwards.
Then i used the directory but this ran not as i hoped.
I use the PHP Coder from www.phpide.de, i think i'll better search for a manual about this development environment.
|
|
|
 |