Navigate
Home
ArticleWiki
Forum
Journal
Search
Newsletter
Links
Tech News
expertsrt.com
Welcome Guest.
Username:

Password:

Remember me

Help Convert PHP to ASP in Shopping Basket
Welcome, Guest. Please login or register.
December 03, 2008, 11:40:35 PM
11306 Posts in 1249 Topics by 499 Members
Latest Member: haulaslemycle
Experts Round Table Network  |  Serverside Technology  |  ASP  |  Help Convert PHP to ASP in Shopping Basket « previous next »
Pages: [1]
Author Topic: Help Convert PHP to ASP in Shopping Basket  (Read 2358 times)
fastrobby

Offline Offline

Posts: 18


« on: April 29, 2007, 05:23:39 PM »

Dear Whomever,
I am trying to integrate a shopping basket script from http://www.dhtmlgoodies.com/scripts/fly-to-basket/fly-to-basket.html  called fly into basket


a) I have a form such as:

<html>
<head>
 <title></title>
<script type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript" src="js/fly- to-basket.js"></script>
<script language="JavaScript" type="text/javascript">
function formButtonFever(formName,action){
 var myString = "document."+formName+"."+action+"();";
 eval(myString);
 }
</script>
</head>
<body>
<form action="SaveBooking.asp" method="post" name="ThaiFunForm" id="ThaiFunForm">
<input type="text" name="FName" size="15">
<input type="text" name="LName" size="15">
<input type="text" name="Qty" size="5">
<input type="text" name="ProductName" size="25">
<div align="center"><a href="#" id="button1" onclick="formButtonFever('ThaiFunForm','submit')"><span
class="alt">Book!</span></a></div>
</form>
</body>
</html>

b) I want to add the fly-to-basket mechanism to this code so that the form variable info is sent to addProduct.asp when onClick event is fired so as to save it to a database.

The onClick event calls the addToBasket() js function found in fly-to-basket.js (code for js found below).

The idea is to add to the existing onClick event the "addToBasket(1);return false;" call to move the submit button to the basket AND to save the form info.

c) The author of fly-to-basket (http://www.dhtmlgoodies.com/index.html?whichScript=fly-to-basket) mentions that the addProduct.php file (defined in flyToBasket.js, found below) can be changed to addProduct.asp to handle this.  However, tests I made in in addProduct.asp showed NO Request.Form or Request.QueryString data received.  The reason, I believe is that the addtobasket() js function doesn't collect form info and instead uses a PHP setvar/getvar (similar to asp session vars) mechanism that is tested after the "fly-by" in a case statement.

d) How do I:

 i) collect the form info in my asp file (shown above)
 ii) send it to the addToBasket() js function
 iii) and have the addProduct.asp subsequently receive the form info, while
 iv) allowing the "flying" action to occur as normal

Supporting files:
fly-to-basket.js all come from the above site
Thanks for any help
Logged
VGR
Mentor

Offline Offline

Posts: 682



WWW
« Reply #1 on: April 30, 2007, 12:36:43 AM »

hummm just some remarks to make you think more of your design :
- why ajax.js while you don't use it
- why the buttonFever() while a type="sublit" button would do the same
- if you want to manually collect the form's data before sending it via .js, it has to be for good reasons : usually, data manipulations to make the FORM(S)'s data match the one expected by the receiver (the PHP/ASP script you post TO ) - in here, I see nu such manipulations, just a silly eval() to submit basically the FORM's data. Again, a standard submit input would do the same and it would work.

Logged

techie overlord, answers all kind of questions on http://www.europeanexperts.org
fastrobby

Offline Offline

Posts: 18


« Reply #2 on: May 01, 2007, 06:35:59 PM »

Many thanks for your reply.
To answer your comment about my desisign. I am just learning this environment. I used the eval() originally to make the form post to my database but now that I'm trying to replace it and use this Fly in basket script so I am totally confused. I use Formfever because my rollover was never stable with a submit and sometimes crashed a CalcMe calculation routine also i have no idea how to make the ajax.js do the posting of the data. Could you please take a moment to look at www.kohchangbookingandinformation/Robby/Diving.asp and show me how to make this thing work. I built this thing myself from zero without any experience and now I am running into some major stubbling blocks.
Once again thanks for your time and help
Robby
Logged
fastrobby

Offline Offline

Posts: 18


« Reply #3 on: May 03, 2007, 04:08:42 PM »

Hi
Sorry that address I posted in the post below was wrong. It's http://www.kohchangbookingandinformation.com/Robby/Diving.asp. I have put my clunky form code into the first Dive Company 1 so it posts to a database and works in a fashion. I need to throw my code out and integrate http://www.dhtmlgoodies.com/scripts/fly-to-basket/fly-to-basket.html.
My problem is that I don't know how the post to a database mechanism works in the fly in the basket script
Thanks Robby
Logged
Pages: [1]
« previous next »
    Jump to: