PDA

View Full Version : php shopping cart problems


MrMikl
August 11th, 2005, 10:36 PM
Renting a server that runs PHP 4.0.3, sounds old, dont know PHP at all. I have written in JSP, looks the same. But not quite. When I did a project in JSP, I had cross over problems, where one person could see the other persons data because the JSP page was serverside. THE PHP book doesnt say, but sounds like PHP is serverside as well.

There is a short article on sessions, but when I try the syntax, my rented version of PHP hates most everything, or ignores commands. Can anyone tell me how i can introduce sessions, or get me started? I need a sure fire shopping cart thats secure and bulletproof. Thanks MrMikl My yahoo msgr id is on here.

degsy
August 11th, 2005, 10:41 PM
If you are not sure about your coding then you would probably be better off purchasing a Shopping Cart System.

or see http://www.phpfreaks.com/tutorials/41/0.php

MrMikl
August 11th, 2005, 11:08 PM
The shopping cart software, is 'commercial' and gives you the source in php format. It does not run. My question is generic, will PHP keep two peoples data accessing the same web page seperate? Or would I have to use sessions?

I have to modify a 'complete' package by myself if I need sessions. I looked around at shopping cart software, but not many companys have phone numbers or online support. Thats why I came here.

If you know of a package that does NOT USE javascript and cookies, I am all for that. But the code they gave is either older or too new, so the rented servers installed version of PHP doesnt understand half of the commands.

Just out of curiosity, how do I find or get the person who logged on their IP address in PHP? Thanks

degsy
August 11th, 2005, 11:16 PM
If it is advertised as a Shopping Cart System then it should be keeping the details seperate. If not then it is not a very good system at all.

You should have a system that uses sessions. It is by far the best way to handle users.


In PHP you can get the IP by different methods.
e.g. http://www.degs.co.uk/

http://uk.php.net/reserved.variables
http://www.w3schools.com/php/php_functions.asp

MrMikl
August 11th, 2005, 11:26 PM
i will keep looking, but it does not appear good, I have read the PHP PHREAKS pages before, but as I said previously, the PHP stmts dont seem to work on this server, odd.

I ran phpinfo and added the remote_addr function, this is the error it came back with:

Fatal error: Call to undefined function: remote_addr() in /home/easymail/public_html/phpi.php on line 11


MrMikl

degsy
August 11th, 2005, 11:44 PM
Can you post the full code of the function.

MrMikl
August 12th, 2005, 12:11 AM
to see what the 3rd party server has

<HTML>
<HEAD>
<TITLE>PHPINFO</TITLE>
<META name="description" content="">
<META name="keywords" content="">
<META name="generator" content="CuteHTML">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">
<?php
echo REMOTE_ADDR();
echo HTTP_CLIENT_IP();
echo phpinfo();
?>

</BODY>
</HTML>

MrMikl

degsy
August 12th, 2005, 12:30 AM
You are not using the functions correctly.
Read the links I posted for the correct syntax.
e.g.

<?php
echo $_SERVER["REMOTE_ADDR"];
?>


phpinfo will also give you info on the other functions that are available.

MrMikl
August 12th, 2005, 05:45 AM
I just copied and pasted the code that I saw. I have seen one function on the page that I had read earlier as tep_get_ip_address, which of course, did not work either. I ran thru alll the PHP functions listed on the page by alphabet and by type but could not find these functions. And the tutorial did not list this at all, perhaps it was in a different section.

I was kind of hoping to find someone who had purchased a particular shopping cart and had a good history with it and could recommend something to me. The 2rd Party hoster only has CGI and PHP available. They have two built in carts, "osCommerence" which, like many other cart software, has no documentation that is extensive enough, and a paypal module, which you must enter everything manually. Which makes it hard to use.

I tried the references for osCommerence, but no one responded back to me, and I could not get it to work right on the server, which says something.

So If anyone has a suggestion, now is the time. Thanks
MrMikl