/    Sign up×
Community /Pin to ProfileBookmark

Puzzling redirection

Hi all-

Background: I have just started programming PHP and MySQL. I took a class at a community college which was a pretty good intro. To get additional exposure similar to what i might have to deal with doing PHP development professionally, i downloaded a project from [url]www.melonfire.com[/url] – a document management system called “The Vault”. It is starting to work. I log in OK. I get to a page where a new document is added to the system.

Problem: When i click submit, i end up going to the error handler file. Looking at the code, i can’t see how this happens.

One thing i did to get this much working. The form submit buttons are all named submit. There is a variable called $submit that they produce. On the exercises that i have done, this interface between HTML and PHP has to be:

$submit = $_REQUEST[“submit”];

i was not aware that you could go straight from HTML to PHP by having a PHP variable named the same as an HTML submit button name. I added the above statement to various places in the project. Otherwise, when you clicked the submit button on the add document page, nothing happens at all except that the document refreshes, thus loosing all the entries. Maybe this is part of my problem.

Regards

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMay 03.2006 — Are you assigning a value to each submit button? This is the value that will be assigned to the 'submit' element in the $_REQEST array. Speaking of which: your code will be more robust if you use the $_POST or $_GET array (depending on whether your form's method is post or get), rather than the $_REQUEST array, which is more ambiguous.
Copy linkTweet thisAlerts:
@balsa8authorMay 03.2006 — I should have included a link directly to the article containing the code that does not work on my version of PHP5 running on Ubuntu 5.10. I inserted REQUEST[] statements and then it started working, sort of:

http://www.melonfire.com/community/columns/trog/article.php?id=64
Copy linkTweet thisAlerts:
@balsa8authorMay 04.2006 — go into php.ini, set register_globals = On, and reboot.

there is still some sort of path problem, but most of the project is now functional.
Copy linkTweet thisAlerts:
@NogDogMay 04.2006 — go into php.ini, set register_globals = On, and reboot.

there is still some sort of path problem, but most of the project is now functional.[/QUOTE]

If that was required, then the code is either several years old (back when the default was to have register_globals on) or is just poorly written.
Copy linkTweet thisAlerts:
@balsa8authorMay 04.2006 — If that was required, then the code is either several years old (back when the default was to have register_globals on) or is just poorly written.[/QUOTE]

I have this idea of doing a web-enabled, secure-access documentation and project management system for new product development using PHP/MySQL.

It had not occurred to me that this project was not a good example of what i am trying to do. Any suggestions of where i might find more up-to-date sample projects? melonfire.com and sourceforge.net i already know about.
Copy linkTweet thisAlerts:
@NogDogMay 04.2006 — http://www.opensourcecms.com/

http://www.hotscripts.com/PHP/Scripts_and_Programs/Content_Management/index.html

I can't vouch for any script you'll find there, but there will be a lot of choices to look at.
×

Success!

Help @balsa8 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...