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

Encrypt php code?
Is it possible to encrypt php code in files,
so that it displays a load of unreadable characters

[Need Help] php timing issues
I don't know what is going wrong. I need some help with being able to set an image at 9:00am Colorad

Please Help my PHP Dating Function.
Hi everyone!

Well here is my code that displays this:

It works wonderful.


Gerenate tabel in Php
I whant to generate a tabel takeing data from database like this one so the results to be display on

SAP Logon Failed
I tried to login to SAP through MMC.

When i click start and give password.

it

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Help Import Animoto and Youtube
CAn someone help me urgently want to allow users on my website to import youtube/revver/dailymotion

Is there something wrong?
Hi all,

Just a quick question... can someone look at this code and see if something is wrong?

tell csv import script to ignore blank rows?
Hi i have the below script but i get an error if a row is blank ie a return in the csv file at the e

mysql VARCHAR acting like INT
Hi, All.

I have a table that contains a varchar(10) column named weird_field. In this column

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