Jump to content

Recommended Posts

Of course, but do be sure to provide the relevant information for the question, and that it's not something you can easily google like "how do I convert a string to uppercase" or something ;) Cause then we'll give you a hard time. Read the links in Dan and my's signatures for advice on getting good help.

 

Best of luck ;)

Thanks very much!

 

So I have a contact form, which queries a SQL database and I want the action to go to my Moodle site, but I'm getting an error 404. The code is this:

 

<form action="http://www.institute-of-photography.com/moodle/login/index.php"> id="voucherForm" method="post" class="voucherForm">

 

What have a I done wrong? Any ideas?

Thanks very much!

 

So I have a contact form, which queries a SQL database and I want the action to go to my Moodle site, but I'm getting an error 404. The code is this:

 

<form action="http://www.institute...gin/index.php"> id="voucherForm" method="post" class="voucherForm">

 

What have a I done wrong? Any ideas?

 

You want your form to POST to a login page? Are you trying to build a "pass-through" so someone can enter their login credentials on your form and be automatically logged in to that site? Could be that site is detecting that and refusing the form submission.

 

 

EDIT: I just did a quick test of copying the form on that login page and submitting to it. I received the error "ADONewConnection: Unable to load database driver", so it is not detecting external form submissions. But, if the name of the form is any indication I don't think you are building a pass-through login form, so I don't see why a voucher form would be posting to a login page. It *could* be valid based upon the logic of that page, but I certainly wouldn't think that is the case if the logic of the site is separated into separate fiels as would be the norm

Edited by Psycho

Error 404 only appears when the page in question does not exist, try making sure the link is spelt right and the page you want them to go to exists.

 

Hello,

 

Thanks for replying.

 

I copied and pasted directly into another browser and the link is fine, it just dosen't work as an action. I thought I might have had a piece of code wrong.

You want your form to POST to a login page? Are you trying to build a "pass-through" so someone can enter their login credentials on your form and be automatically logged in to that site? Could be that site is detecting that and refusing the form submission.

 

It could be that. It is Moodle, so I wonder if I need to authenticate it. Anyone know anything about authentication in Moodle?

You want your form to POST to a login page? Are you trying to build a "pass-through" so someone can enter their login credentials on your form and be automatically logged in to that site? Could be that site is detecting that and refusing the form submission.

 

 

EDIT: I just did a quick test of copying the form on that login page and submitting to it. I received the error "ADONewConnection: Unable to load database driver", so it is not detecting external form submissions. But, if the name of the form is any indication I don't think you are building a pass-through login form, so I don't see why a voucher form would be posting to a login page. It *could* be valid based upon the logic of that page, but I certainly wouldn't think that is the case if the logic of the site is separated into separate fiels as would be the norm

 

Well, what I'm trying to do is have a 'voucher redemption page'. Users would get a special code, fill in their details including the 'voucher code', this would query a database and if the code was recognised, it would allow login to Moodle.

 

This is so that I can sell my online courses through Groupon for example.

 

What do you think?

Then it sounds like you should be submitting the form to a different page - not the login page. You *may* have coded it to work that way, I don't really know. But, I would create a page called something like redeemVoucher.php to submit that form to. Have that page do the validation and if everything passes, set a session value and redirect to the login page. On the login page do a check for that session value, if not set redirect to the voucherForm page.

Then it sounds like you should be submitting the form to a different page - not the login page. You *may* have coded it to work that way, I don't really know. But, I would create a page called something like redeemVoucher.php to submit that form to. Have that page do the validation and if everything passes, set a session value and redirect to the login page. On the login page do a check for that session value, if not set redirect to the voucherForm page.

 

Wow that sounds exactly the right thing to do, but I've gotten lost in the translation a bit. Sorry :-)

 

That did work a bit, I changed it to the right page name which I found in the php file and it is now taking me to the Moodle login page, but when I use the username password to login, I get that ADO Database thing and I'm not sure what to do next.

The issue you are having doesn't seem to have anything to do with your original question. Sounds like you are unable to get your Moodle installation working - then this is the wrong forum. This forum if for getting help with PHP code you have written.

 

You should probably post in the Third Party Scripts forum: http://forums.phpfreaks.com/forum/26-third-party-php-scripts/

I was a huge noob when I found this forum too! Now I am an "Advanced Member." Doesn't mean much, but it makes me feel good.

 

There is one of the resources I use to learn PHP. Everyone is really nice here. I am here almost everyday now. Ask away!

 

From one new guy to another I would also suggest checking out website critique and the miscellaneous forum. Lots of fun stuff going on there.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.