php-general Digest 16 May 2005 08:21:26 -0000 Issue 3457

Topics (messages 215263 through 215275):

Re: Re-initiating an autostarted session
        215263 by: Ville Mattila

Re: what am I missing..interpolation?
        215264 by: Evert | Rooftop
        215265 by: Marek Kilimajer
        215269 by: Richard Lynch

Re: I have some upload questions.
        215266 by: Marek Kilimajer
        215268 by: Richard Lynch

Re: Shopping Cart, security concerns
        215267 by: mayo

OT - news.php.net server problems?
        215270 by: Jamie

Re: Repost: mod_rewirte loses POST data
        215271 by: Evert | Rooftop

IO timeout
        215272 by: AC

Re: domxml problem
        215273 by: Georgi Ivanov

Re: dynamically updating site
        215274 by: Angelo Zanetti

PHP-GTK, or something else, for desktop app development?
        215275 by: Murray . PlanetThoughtful

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message --- Leif Gregory wrote:
session_destroy();
session_start();
session_write_close();
Header("Location: ...");
exit;

I never tried regenerate. Just started a new session again.

Hi Leif!

Thanks for your reply. For some strange reason, this works not for me. The session cookie will not 
be overwritten and the user won't get a new session id - even all the session data from the server 
is destroyed. I tried to unset the session cookie manually (setcookie( session_name() 
,"",0,"/");) but without results.

Thanks also Mr. Jason Barrett for your reply, but I couldn't manage to get the 
session regeneration work.

So, I'm still looking for a solution... =)

Thanks,
Ville

--- End Message ---
--- Begin Message ---
Shouldn't that be:
eval("echo \"$string\"");

its pretty insecure though, be sure your users are not allowed to change the db field, because they can do some serious damage.

grt,
Evert

Krid wrote:

Hi!
Try
eval("echo $string");

blackwater dev wrote:

Hello,

this works fine:

$name="fido";
$string="my dog's name is $name";
echo $string;//prints my dog's name is fido

but when I store the string "my dog's name is $name" in the db and pull it out:

//do the query
$row=$datab->fetch();
$name="fido";
$string=$name['db_column'];
echo $string//prints my dog's name is $name

How can I get it to work with the db?

Thanks!



--- End Message ---
--- Begin Message --- blackwater dev wrote:
Hello,

this works fine:

$name="fido";
$string="my dog's name is $name";
echo $string;//prints my dog's name is fido

but when I store the string "my dog's name is $name" in the db and pull it out:

//do the query
$row=$datab->fetch();
$name="fido";
$string=$name['db_column'];
echo $string//prints my dog's name is $name

How can I get it to work with the db?

eval is an answer, but str_replace is much more secure:

$string = str_replace('$name', $name, $string);
--- End Message ---
--- Begin Message ---
On Sun, May 15, 2005 8:27 am, blackwater dev said:
> Thanks for the info but I tried it both ways and get this error:
>
> Parse error: parse error, unexpected T_FOR, expecting ',' or ';' in
> dogs.php(11) : eval()'d code on line 1
>
>
> On 5/15/05, Krid <[EMAIL PROTECTED]> wrote:
>> Hi!
>> Try
>> eval("echo $string");

I dunno where the T_FOR came from, but you may need a ; after $string:

eval("echo $string;");

I'm also guessing maybe $string doesn't have what you think it has...

echo "string is: $string<hr />\n";

before you do the eval so you know what you are doing.

Or even:
$php = "echo $string;";
echo "evaluating: $php<hr />\n";
eval($php);

Now you'll see the PHP code you are trying to run, right before the error
message about it.

-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message --- Lee Chen wrote:
If the server uses hub ( to make more computer connect online),  can' I
upload files
to that server??

if you can post forms, you can upload files.


I face a problem like this , and I think that's the hub causing this problem. Did it?

what is "like this"?

--- End Message ---
--- Begin Message ---
On Sun, May 15, 2005 9:09 am, Lee Chen said:
> If the server uses hub ( to make more computer connect online),  can' I
> upload files
> to that server??
>
> I face a problem like this ,  and I think that's the hub causing this
> problem.
> Did it?
>
> or if I can do something to solve this problem?
>
> (btw I am the administrator of that server. I can do anything on that
> server)

Can your surf to that server?

Can you fill out a form and get POST data?

Did you remember the ENCTYPE="application/form-data" attribute on your
FORM tag?  That one gets ya every time for the first few file uploads.

-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
No, I would not have prices in the hidden fields. :-) 
Thanks though for the concern.

I do have a few questions about easiest / best way to write this.
Especially as I don't have PHP experience, meaning it takes me longer to
write the code and more importantly I might miss something important.

======

Shopping Cart display

Item Qty (allow user to change or delete)
Item ID (added to session variable by hidden field)
Item Name (added to session variable by hidden field)
Item Desc Short (added to session variable by hidden field) Item Price
(hardcoded. I hate this but it would be pulled from a file or hardcoded
- an if else clause. If itemID = 1 then price = x)


Page 1 (Shipping Info: Name, Address...)

Info forwarded to page two in hidden fields)

Page 2 (Billing Address: Name, Address ...)

Info forwarded to page three in hidden fields

Page 3 - confirmation page

Page 4 (CC info)

Page 5 (Hidden from consumer Security Check Page)

Qty * Price = Qty
Tax recalculated
Shipping recalculated

Relevant data sent to merchant and distributor company

Thanks





-----Original Message-----
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: Saturday, May 14, 2005 10:52 PM
To: mayo
Cc: 'php'
Subject: RE: [PHP] Shopping Cart, security concerns

On Sat, May 14, 2005 6:30 am, mayo said:
> I have to say it's a pretty simple project. The don't want to keep any
> information in a db. (!!??!!) Info will be sent to a merchant services
> account and to the distributor which will process the form.
>
> Info will be kept in hidden fields <input type="hidden" ...> and in
> session variables then sent off.

Don't put anything you *NEED* to be correct/accurate in type="hidden"

The web surfer can *CHANGE* that in about 5 seconds and send whatever
they
want.

All your prices, all you shipping costs, all the weights, etc had better
be in your PHP source code, as arrays, I guess...

You'd really be better off just using a database with an existing cart.

The amount of code you'll have to write to do this correctly is insane.

> They have three products (it may rise to 5) and everything will be
> hardcoded  as there are no size or color variations. I told them that
> it's not advisable to have everything hardcoded but the client insists
> there is no reason to pull anything from a database. The on-site
> graphics/web designer person will make the changes. He is competent to
> do that and did a good job with the basic design.

But you CANNOT put your prices in type="hidden" fields!!!

That's EXACTLY how you get a shopping cart where the user changes the
price!

> This is not my very first foray into PHP but first time doing
something
> more complicated than
>
> 1. if person has this permission then show A else show B
>
> or
>
> 2. if person is on page 1 then show page 1 as bold else show page 1 as
> normal

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hi, i know its a little off topic, and its probably just me. But has
anyone else been having problems with the nntp ervers news.php,net?
more precisely connections being closed unespectedly? just checking to
see :)

Thanks
Jamie

--- End Message ---
--- Begin Message ---
Bart Seresia wrote:

Evert from collan thouht it wy have to do with the rewrite rules or the script and asked to post both of them



Yea I replied with the wrong e-mail address so it didn't end up here..

this are the rewrite rules i use:

[snip]

In IE i get this output for post and get:

[snip]

Am i doing something wrong?



I can't find anything in your scripts.. are you sure you are sending the form with POST?
Try to narrow down the issue to 1 simple script and try to find if this is a mod_rewrite issue or a php issue. Be sure you have the latest versions of both (apache and php).


grt,
Evert

--- End Message ---
--- Begin Message ---
Anyone using the dio_read function?

I'm having issues trying to keep dio_read from hanging if there's no data to read.

Anyone know of a work around or hack to mimic a timeout?
--- End Message ---
--- Begin Message ---
On Friday 13 May 2005 20:03, Brian V Bonini wrote:
> On Fri, 2005-05-13 at 10:31, Georgi Ivanov wrote:
> > But it gives me error on this line :
> > $DomDocument = domxml_open_file($file);
>
> What's the error?

The error is :
"Call to undefined function"
I tried with the new function ( domxml_open_file) and depricated one 
(xmldocfile)
There is no dom_xml_file function .


> Try:
>
> $dom = dom_xml_file($file);
>
>
> --
>
> s/:-[(/]/:-)/g
>
>
> Brian        GnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
> ======================================================================
> gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
> Key Info: http://gfx-design.com/keys
> Linux Registered User #339825 at http://counter.li.org

--- End Message ---
--- Begin Message ---
content management systems..like plone.org

or creating your own system, with a backend where you update the text
with a html teatarea editor (like bold italic etc...) and then update
the DB and walla!

hope this helps.

Angelo Zanetti
Z Logic
www.zlogic.co.za
[c] +27 72 441 3355
[t] +27 21 469 1052



Sebastian wrote:

>I looking for a way to update certain parts of a site that is highly
>dynamic. I've tried creating static files via cronjobs then including them,
>but it is a pain to do. for instance, i have a news page that utilizes
>mysql, rather than query the DB on each page load i would like to have it
>update at say 5 minute intervals.. not sure if this is possible to do
>without generating static files..
>
>any suggestions?
>
>  
>

--- End Message ---
--- Begin Message ---
Hi All,

I'd like to do some desktop app development and I'm looking for others'
thoughts on whether PHP-GTK is a suitable environment in which to work?

Years ago I developed desktop apps in Access / VB6, but it's been long
enough now, and VB in particular has changed so much in the intervening
time, that I'd have to relearn these anyway, so it seems like a good time to
either consolidate my PHP coding or to pick up some other language. Not to
mention that Access is entirely despicable for any purpose, desktop app
development included [1].

I'm wondering if PHP-GTK is mature / featured enough to handle a relatively
complex desktop app project, using features like table grids for displaying
/ editing data stored in a MySQL backend and so on.

My other alternative is to bite the bullet and learn something like Java,
though I assume my learning curve would be steeper and more time-consuming.
I pick Java because a) Everyone Seems To Love Java<tm>, and b) there appear
to be at least a couple of decent free Java IDEs available in NetBeans and
Eclipse (and maybe others that I don't know about).

In essence, I'm looking for a desktop app development environment that is
featured, connects well to MySQL, and is relatively painless to learn. Java
may not suit the last of those criteria, but I don't know enough about it at
this point to be scared of it if it is painful to learn.

Anyone have any thoughts to share about PHP-GTK and / or other desktop app
development environments that might be more suitable? Freeness of
development tools is a big plus to me in this, if that needs to be
explicitly said.

Much warmth,

Murray

[1] Just my opinion. I know I'd get a healthy argument from several
developers that I know.

--- End Message ---

Reply via email to