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....

Did you know?Explore Trending and Topic pages for more stories like this.
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

Internal Server Error issues
This has been bothering me for weeks and I've been trying to solve it without asking for help, but e

Trying to add functions to table
I have this list of characters and I'm trying to figure out what I have to do to put the results of

mysql UNION | warning mysql_fetch_array !!
Code: <?php
$i = 0;
$query1="SELECT * FROM `products` WHERE `div

Grabbing Values From an Array for Posting
I have a grid array that I am using with a form that when it hits the currently named test.php it lo

Sendmail.php - heading error following check_input
Hi,

I would greatly appreciate some help? I am brand new to PHP and have been searching and e

PHP Game
hy i was wondering what's the best method in order to make some automatic updates in a php game
<

Calculating a rating by adding number of points and dividing by number of items
I have a site that users can post links to files to download. They can rate these files on a 1-5 sca

question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.

I hav

how to get IP address?
hey guys,

i have this code which is supposed to get me the IP address of my site visitors:

mysql timestamp manipulation
How could I use a timestamp (e.g 2009-10-30 13:20:35 ), and with php find out if it is:

from

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