[Solved][PHP]Quick question (functions and forms)

Questions about programming languages and debugging
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

[Solved][PHP]Quick question (functions and forms)

Post by ayu »

I have 2 files.

index.php
main.php

in the main.php, I have a function with a form in it.

The function is called in index.php.

The only problem is that when I submit the form information from the form in the function (form pointing towards index.php form action="index.php") the info doesn't seem to be sent to index.php

Because I made a test in the index file with echo $_POST['var'];

But nothing showed up.


Is there something I have missed when it comes to functions and forms? or is it just a common mistake somewhere? ^^
Last edited by ayu on 10 Nov 2007, 06:55, edited 1 time in total.
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

um, included main.php in index.php? :-k
http://de.php.net/include/

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

jupp...well nevermind...i found the problem -.-

The thing is that i recently started to divide all my functions into different files since the files were getting to messy.

So i just copy and pasted most of the code and modified it to fit. and i forgot a variable that gets it's values from another file, and it can't get it anymore since it's in another one now. ^^


Long story short: My own stupid "common" mistake
"The best place to hide a tree, is in a forest"

Post Reply