PHP Function Page Advice


Posted on 16th Feb 2014 07:03 pm by admin

Hi All, I am quite new to PHP and Javascript but have written an Online Shop (Mainly for Fun and education)

It uses MySQL for the Shop Item Data and a 'Username.txt' file for each users cart. (Formated as 'ItemID1xQty1, ItemID2xQty2' etc....

From the Cart View window, the user can edit the Quantity (Form text field).
When the 'Update Cart' Form button is clicked, a Javascript function;
re-calculates the monetry valuesdisplays the changesCreates a String containing the new cart dataCalls a PHP page (cart_update.php), that writes the Data to the UserName.txt file
This all works fine, except......
cart_update.php needs to do it's stuff and close. - But it doesn't close so the user is left with a blank window that has to be closed manually.

The cart data is posted from hidden form elements to cart_update.php.
using javascript to close the window results in the 'Do you want To Close this Window' message..
using JS History or $_SERVER['HTTP_REFERER'] refreshes the Cart View window to its pre-edited state

Is there a way round this..?
Can I put the cart_update.php code somewhere other than a .php page?

So close but so far..

Any help will be greatly appreciated..

No comments posted yet

Your Answer:

Login to answer
294 Like 45 Dislike
Previous forums Next forums
Other forums

cyrillic string conversion question
Hello,

First time here...

I would like to know if there is a way to convert a

A little help needed passing hidden values to next page
I have a page that has hidden values in a form.

example
Code: <input name='signupID

Getting PHP to ammended the selected in option field
Hey Guys

thanks for everyones help so far. This site and its users are oozing awesomness.

how to make database item unique
Hey guys,

is it possible to do this:

I have the database item $title being pulled for

b+ tree
Hi
can every body help me about b+ tree ?(insert & delete)

Guixt issue
Hello all,

We are experiencing the following problem with Guixt:

Some transact

PHP switch function help
Hi, I am trying to create a search function for a directory website. On the search function on html

To change the name of label on SAP screen XK02.
Hi All,

Can one suggest me how to change the label of an input field of a sap standard s

POST into Array problem
Hi Chaps,

I have a repeat region, displaying rows of data: jobid, fromtable, translatorcharge

help with variable
I've got a problem, i want to echo some images depending on the $id, however for me to get that id i

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash