473,503 Members | 3,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

post and php (newbie question)


Hi,

Does anyone know if it's possible to post to a page without using a
form? For example, if I want to pass a variable to another page
without using a cookie, is there a way to pass it using post?

Thank you,
Phil
Aug 16 '08 #1
24 1588
On 2008-08-16, cp******@gmail.com <cp******@gmail.comwrote:
>
Hi,

Does anyone know if it's possible to post to a page without using a
form? For example, if I want to pass a variable to another page
without using a cookie, is there a way to pass it using post?

Thank you,
Phil
The short answer is no.

However, it might be possible to create some hack using AJAX to
send data specific to the user's system (I don't know what might
be unique) and then dynamically generate the rest of the page
based on that.

This fails spectacularly when JS is disabled, though.

Why not just use cookies?

--
Andrew Poelstra ap*******@wpsoftware.com
To email me, use the above email addresss with .com set to .net
Aug 16 '08 #2
Andrew Poelstra wrote:
On 2008-08-16, cp******@gmail.com <cp******@gmail.comwrote:
>Hi,

Does anyone know if it's possible to post to a page without using a
form? For example, if I want to pass a variable to another page
without using a cookie, is there a way to pass it using post?

Thank you,
Phil

The short answer is no.

However, it might be possible to create some hack using AJAX to
send data specific to the user's system (I don't know what might
be unique) and then dynamically generate the rest of the page
based on that.

This fails spectacularly when JS is disabled, though.

Why not just use cookies?
Why nor just simply enclose it in a form? BTW, what happens with
writing to cookies to pass information if the user has cookies disabled?
Aug 16 '08 #3
cp******@gmail.com wrote:
Hi,

Does anyone know if it's possible to post to a page without using a
form? For example, if I want to pass a variable to another page
without using a cookie, is there a way to pass it using post?

Thank you,
Phil
You can't post to a page. But why not put the variable in the $_SESSION
array? That's what it's there for.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 16 '08 #4
On 2008-08-16, sheldonlg <sheldonlgwrote:
Andrew Poelstra wrote:
>On 2008-08-16, cp******@gmail.com <cp******@gmail.comwrote:
>>Hi,

Does anyone know if it's possible to post to a page without using a
form? For example, if I want to pass a variable to another page
without using a cookie, is there a way to pass it using post?

Thank you,
Phil

The short answer is no.

However, it might be possible to create some hack using AJAX to
send data specific to the user's system (I don't know what might
be unique) and then dynamically generate the rest of the page
based on that.

This fails spectacularly when JS is disabled, though.

Why not just use cookies?

Why nor just simply enclose it in a form?
Because that would require a form-submission to reach every page.
BTW, what happens with writing to cookies to pass information
if the user has cookies disabled?
I've tried browsing without cookies. Oftentimes it is much faster and
sites are easier to use - and consistent, since they are stateless -
but I can log into very few sites. I don't consider this a fault of
any given site, nor do most users who have the presence-of-mind to
disable cookies.

The only two technically-feasable ways to maintain session data is
through cookies or URL rewriting. The former will not, as you say,
work without cookies, but the latter is fraught with peril.

--
Andrew Poelstra ap*******@wpsoftware.com
To email me, use the above email addresss with .com set to .net
Aug 16 '08 #5
On 2008-08-16, Jerry Stuckle <js*******@attglobal.netwrote:
cp******@gmail.com wrote:
>Hi,

Does anyone know if it's possible to post to a page without using a
form? For example, if I want to pass a variable to another page
without using a cookie, is there a way to pass it using post?

Thank you,
Phil

You can't post to a page. But why not put the variable in the $_SESSION
array? That's what it's there for.
$_SESSION still depends on cookies or URL rewriting behind the scenes to
keep its session data associated with the appropriate user.
--
Andrew Poelstra ap*******@wpsoftware.com
To email me, use the above email addresss with .com set to .net
Aug 16 '08 #6
On Aug 15, 9:53*pm, cplxp...@gmail.com wrote:
Hi,

Does anyone know if it's possible to post to a page without using a
form? *For example, if I want to pass a variable to another page
without using a cookie, is there a way to pass it using post?

Thank you,
Phil
Yes why not it can be done with AJAX
Aug 16 '08 #7
On 2008-08-16, raashid bhatt <ra*********@yahoo.comwrote:
On Aug 15, 9:53*pm, cplxp...@gmail.com wrote:
>Hi,

Does anyone know if it's possible to post to a page without using a
form? *For example, if I want to pass a variable to another page
without using a cookie, is there a way to pass it using post?

Thank you,
Phil

Yes why not it can be done with AJAX
Because AJAX requires javascript, which should never be used for
site-critical functionality.

--
Andrew Poelstra ap*******@wpsoftware.com
To email me, use the above email addresss with .com set to .net
Aug 16 '08 #8
..oO(Andrew)
>On 2008-08-16, Jerry Stuckle <js*******@attglobal.netwrote:
>>
You can't post to a page. But why not put the variable in the $_SESSION
array? That's what it's there for.

$_SESSION still depends on cookies or URL rewriting behind the scenes to
keep its session data associated with the appropriate user.
Sure, but it's the correct way for passing data from one page to another
and in such cases I simply require a session cookie on my sites.

Micha
Aug 16 '08 #9
..oO(raashid bhatt)
>On Aug 15, 9:53*pm, cplxp...@gmail.com wrote:
>Hi,

Does anyone know if it's possible to post to a page without using a
form? *For example, if I want to pass a variable to another page
without using a cookie, is there a way to pass it using post?

Thank you,
Phil

Yes why not it can be done with AJAX
AJAX will cause usability and accessibility problems if not done
properly. And in this case it's definitely the wrong tool.

Micha
Aug 16 '08 #10

Thank you everyone for the replies. I suppose that the best answer is
to use variables in $_SESSION? I am just learning PHP; while I'm
pretty good at C++, I've never done serious web programming before, so
while I had just learned about cookies, I haven't gotten to the
session tutorial yet.

Thanks again for the info. I have a follow-up question, if that's
alright...can anyone recommend a single PHP book that is good for
picking up PHP quickly for web application development that is geared
towards people with a programming background? I have the PHP for
Dummies guide somewhere, but as I recall it wasn't very advanced. I
read somewhere about the Safari books...are they any good?

Thanks again,
Phil
Aug 16 '08 #11
On 2008-08-16, cp******@gmail.com <cp******@gmail.comwrote:
>
Thank you everyone for the replies. I suppose that the best answer is
to use variables in $_SESSION? I am just learning PHP; while I'm
pretty good at C++, I've never done serious web programming before, so
while I had just learned about cookies, I haven't gotten to the
session tutorial yet.

Thanks again for the info. I have a follow-up question, if that's
alright...can anyone recommend a single PHP book that is good for
picking up PHP quickly for web application development that is geared
towards people with a programming background? I have the PHP for
Dummies guide somewhere, but as I recall it wasn't very advanced. I
read somewhere about the Safari books...are they any good?
I learnt a lot from Professional PHP5, ISBN 978-0764572821.

It also had a very useful chapter on session handling.

--
Andrew Poelstra ap*******@wpsoftware.com
To email me, use the above email addresss with .com set to .net
Aug 16 '08 #12
Andrew wrote:
On 2008-08-16, Jerry Stuckle <js*******@attglobal.netwrote:
>cp******@gmail.com wrote:
>>Hi,

Does anyone know if it's possible to post to a page without using a
form? For example, if I want to pass a variable to another page
without using a cookie, is there a way to pass it using post?

Thank you,
Phil
You can't post to a page. But why not put the variable in the $_SESSION
array? That's what it's there for.

$_SESSION still depends on cookies or URL rewriting behind the scenes to
keep its session data associated with the appropriate user.

And anyone who doesn't allow any of that isn't going to be visiting many
websites. Virtually every website (at least the good ones) which use
logins uses sessions in one language or another. And virtually every
site which saves data between pages uses sessions and/or cookies at some
time or another.

If you don't want to use cookies and don't want to use sessions, then
you must either post the data from a form or put in the in the URL.
That's the only way you can pass data between pages.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 16 '08 #13
Michael Fesser wrote:
.oO(Andrew)
>On 2008-08-16, Jerry Stuckle <js*******@attglobal.netwrote:
>>You can't post to a page. But why not put the variable in the $_SESSION
array? That's what it's there for.
$_SESSION still depends on cookies or URL rewriting behind the scenes to
keep its session data associated with the appropriate user.

Sure, but it's the correct way for passing data from one page to another
and in such cases I simply require a session cookie on my sites.

Micha
Its not the 'correct' way. Its 'A' way.

It has its good and bad points like anything else.
Aug 16 '08 #14
..oO(The Natural Philosopher)
>Michael Fesser wrote:
>>
Sure, but it's the correct way for passing data from one page to another
and in such cases I simply require a session cookie on my sites.
Its not the 'correct' way. Its 'A' way.

It has its good and bad points like anything else.
It's the correct way, since the alternatives have much more drawbacks
and security issues.

Micha
Aug 16 '08 #15
Michael Fesser wrote:
.oO(The Natural Philosopher)
>Michael Fesser wrote:
>>Sure, but it's the correct way for passing data from one page to another
and in such cases I simply require a session cookie on my sites.
Its not the 'correct' way. Its 'A' way.

It has its good and bad points like anything else.

It's the correct way, since the alternatives have much more drawbacks
and security issues.

Micha
I agree, Micha - it is much better than any of the other choices.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 16 '08 #16
Michael Fesser wrote:
.oO(The Natural Philosopher)
>Michael Fesser wrote:
>>Sure, but it's the correct way for passing data from one page to another
and in such cases I simply require a session cookie on my sites.
Its not the 'correct' way. Its 'A' way.

It has its good and bad points like anything else.

It's the correct way, since the alternatives have much more drawbacks
and security issues.

Micha
Dont be silly.

All sessions are are a pre-built system to pass a session ID between
browser and driver, using either a URL GET or a cookie.
Which is the only way it CAN be done.

So sessions are nothing special at all. They are as secure or insecure
as any other system using the same basic token passing methods.
Aug 17 '08 #17
The Natural Philosopher wrote:
Michael Fesser wrote:
>.oO(The Natural Philosopher)
>>Michael Fesser wrote:
Sure, but it's the correct way for passing data from one page to
another
and in such cases I simply require a session cookie on my sites.

Its not the 'correct' way. Its 'A' way.

It has its good and bad points like anything else.

It's the correct way, since the alternatives have much more drawbacks
and security issues.

Micha
Dont be silly.

All sessions are are a pre-built system to pass a session ID between
browser and driver, using either a URL GET or a cookie.
Which is the only way it CAN be done.

So sessions are nothing special at all. They are as secure or insecure
as any other system using the same basic token passing methods.
Coming from someone who truly has no idea about site security...

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 17 '08 #18
..oO(The Natural Philosopher)
>Michael Fesser wrote:
>.oO(The Natural Philosopher)
>>Michael Fesser wrote:
Sure, but it's the correct way for passing data from one page to another
and in such cases I simply require a session cookie on my sites.

Its not the 'correct' way. Its 'A' way.

It has its good and bad points like anything else.

It's the correct way, since the alternatives have much more drawbacks
and security issues.

Micha
Dont be silly.

All sessions are are a pre-built system to pass a session ID between
browser and driver, using either a URL GET or a cookie.
We were talking about how to pass data from one page to another, not
about how to implement a session management.
>So sessions are nothing special at all. They are as secure or insecure
as any other system using the same basic token passing methods.
For the issue this thread is all about sessions are more secure, simply
because the data stored there never leaves the server. All other methods
(cookies, GET, POST) expose the data to the client, which makes it easy
to manipulate and requires validation over and over again on every page
that wants to use it.

Client data can be never be trusted, while the session container can be
considered a secure environment. Hence it's in many cases the preferred
way for keeping data across several HTTP requests.

Micha
Aug 18 '08 #19
Michael Fesser wrote:
.oO(The Natural Philosopher)
>Michael Fesser wrote:
>>.oO(The Natural Philosopher)

Michael Fesser wrote:
Sure, but it's the correct way for passing data from one page to another
and in such cases I simply require a session cookie on my sites.
>
Its not the 'correct' way. Its 'A' way.

It has its good and bad points like anything else.
It's the correct way, since the alternatives have much more drawbacks
and security issues.

Micha
Dont be silly.

All sessions are are a pre-built system to pass a session ID between
browser and driver, using either a URL GET or a cookie.

We were talking about how to pass data from one page to another, not
about how to implement a session management.
>So sessions are nothing special at all. They are as secure or insecure
as any other system using the same basic token passing methods.

For the issue this thread is all about sessions are more secure, simply
because the data stored there never leaves the server. All other methods
(cookies, GET, POST) expose the data to the client, which makes it easy
to manipulate and requires validation over and over again on every page
that wants to use it.

Client data can be never be trusted, while the session container can be
considered a secure environment. Hence it's in many cases the preferred
way for keeping data across several HTTP requests.

Micha
Forget it, Micha. He's one again proving he has no idea what he's
talking about.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 18 '08 #20
..oO(Jerry Stuckle)
>Forget it, Micha. He's one again proving he has no idea what he's
talking about.
But most^Wmany^Wsome people are able to learn. ;)

Micha
Aug 18 '08 #21
Michael Fesser wrote:
.oO(The Natural Philosopher)
>Michael Fesser wrote:
>>.oO(The Natural Philosopher)

Michael Fesser wrote:
Sure, but it's the correct way for passing data from one page to another
and in such cases I simply require a session cookie on my sites.
>
Its not the 'correct' way. Its 'A' way.

It has its good and bad points like anything else.
It's the correct way, since the alternatives have much more drawbacks
and security issues.

Micha
Dont be silly.

All sessions are are a pre-built system to pass a session ID between
browser and driver, using either a URL GET or a cookie.

We were talking about how to pass data from one page to another, not
about how to implement a session management.
>So sessions are nothing special at all. They are as secure or insecure
as any other system using the same basic token passing methods.

For the issue this thread is all about sessions are more secure, simply
because the data stored there never leaves the server.
That can be the case for any other system that merely passes a session
ID and leaves the data on the server.

>All other methods
(cookies, GET, POST) expose the data to the client, which makes it easy
to manipulate and requires validation over and over again on every page
that wants to use it.
You don't seem to understand tat all a session is, is reducing the data
passed to *ONE* GET POST or cookie.

You cam implement that yourself easily, and probably more securely than
sessions does..by e.g. storing 'session' data in a database.

Intrinsically all sessions are, is a wrapper round a basic GET or
cookie token passing system, and are not more secure than any other way
that might be implemented.

>
Client data can be never be trusted, while the session container can be
considered a secure environment. Hence it's in many cases the preferred
way for keeping data across several HTTP requests.
You may consider it secure if you want. Excuse me if I consider the
possibility that someone else might easily 'steal' a session.
>
Micha
Aug 18 '08 #22
Jerry Stuckle wrote:
Michael Fesser wrote:
>.oO(The Natural Philosopher)
>>Michael Fesser wrote:
.oO(The Natural Philosopher)

Michael Fesser wrote:
>Sure, but it's the correct way for passing data from one page to
>another
>and in such cases I simply require a session cookie on my sites.
>>
Its not the 'correct' way. Its 'A' way.
>
It has its good and bad points like anything else.
It's the correct way, since the alternatives have much more drawbacks
and security issues.

Micha
Dont be silly.

All sessions are are a pre-built system to pass a session ID between
browser and driver, using either a URL GET or a cookie.

We were talking about how to pass data from one page to another, not
about how to implement a session management.
>>So sessions are nothing special at all. They are as secure or
insecure as any other system using the same basic token passing methods.

For the issue this thread is all about sessions are more secure, simply
because the data stored there never leaves the server. All other methods
(cookies, GET, POST) expose the data to the client, which makes it easy
to manipulate and requires validation over and over again on every page
that wants to use it.

Client data can be never be trusted, while the session container can be
considered a secure environment. Hence it's in many cases the preferred
way for keeping data across several HTTP requests.

Micha

Forget it, Micha. He's one again proving he has no idea what he's
talking about.
Reversing the truth may make you feel better Jerry, but it doesn't
change the truth.

Tell me how a session ID is preserved between multiple broswer
connections without using a GET or cookie.

I asked you before, and you failed to answer.

I even posted the PHP manual section where it explicitly states that its
done via a GET or cookie.

The natural conclusion is you either knew you were wrong, or didn't know
the answer at all.
Aug 18 '08 #23
The Natural Philosopher wrote:
Jerry Stuckle wrote:
>Michael Fesser wrote:
>>.oO(The Natural Philosopher)

Michael Fesser wrote:
.oO(The Natural Philosopher)
>
>Michael Fesser wrote:
>>Sure, but it's the correct way for passing data from one page to
>>another
>>and in such cases I simply require a session cookie on my sites.
>>>
>Its not the 'correct' way. Its 'A' way.
>>
>It has its good and bad points like anything else.
It's the correct way, since the alternatives have much more drawbacks
and security issues.
>
Micha
Dont be silly.

All sessions are are a pre-built system to pass a session ID between
browser and driver, using either a URL GET or a cookie.

We were talking about how to pass data from one page to another, not
about how to implement a session management.

So sessions are nothing special at all. They are as secure or
insecure as any other system using the same basic token passing
methods.

For the issue this thread is all about sessions are more secure, simply
because the data stored there never leaves the server. All other methods
(cookies, GET, POST) expose the data to the client, which makes it easy
to manipulate and requires validation over and over again on every page
that wants to use it.

Client data can be never be trusted, while the session container can be
considered a secure environment. Hence it's in many cases the preferred
way for keeping data across several HTTP requests.

Micha

Forget it, Micha. He's one again proving he has no idea what he's
talking about.
Reversing the truth may make you feel better Jerry, but it doesn't
change the truth.

Tell me how a session ID is preserved between multiple broswer
connections without using a GET or cookie.

I asked you before, and you failed to answer.

I even posted the PHP manual section where it explicitly states that its
done via a GET or cookie.

The natural conclusion is you either knew you were wrong, or didn't know
the answer at all.
The "natural conclusion" can only be drawn by a total idiot. Which is
why it doesn't surprise me that you came to it.

I've tried explaining it to you many times before. But either you are
too stoopid to learn, or don't want to learn.

Either way, I'm not going to try to explain it to you any more. It's as
effective as teaching a pig to sing.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 18 '08 #24
..oO(The Natural Philosopher)
>>All other methods
(cookies, GET, POST) expose the data to the client, which makes it easy
to manipulate and requires validation over and over again on every page
that wants to use it.

You don't seem to understand tat all a session is, is reducing the data
passed to *ONE* GET POST or cookie.
Irrelevant here.
>You cam implement that yourself easily, and probably more securely than
sessions does..by e.g. storing 'session' data in a database.
A simple DB is as secure as a flat file.
>Intrinsically all sessions are, is a wrapper round a basic GET or
cookie token passing system, and are not more secure than any other way
that might be implemented.
They are more secure than passing the same data by GET or POST, as I've
already explained.
>Client data can be never be trusted, while the session container can be
considered a secure environment. Hence it's in many cases the preferred
way for keeping data across several HTTP requests.

You may consider it secure if you want. Excuse me if I consider the
possibility that someone else might easily 'steal' a session.
And what does this have to do with the possibility of manipulating the
actual data? It's the data we're talking about here, nothing else. GET
and POST data is easy to fake, SESSION data is safe. It's that simple.

And stealing a session is not that easy if you do it right.

Micha
Aug 18 '08 #25

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2071
by: stuie... | last post by:
First off, I'm a newbie to PHP and server side scripting. I'm curious if there are any specific guidelines as to when one should use "GET" or "POST" in forms processing. I've had issues moreso...
4
2615
by: Bloon | last post by:
I have a question that how to debug a program only having .exe file. Is there any techniques or tools that can do that? Thanks a lot.
8
5063
by: Gert | last post by:
Hi, I have a form (server side) because of the filling of variables through the application. But now I need to post it to an url on submit. My .HTML form looks like this, but how to translate it...
4
1917
by: Vinayak | last post by:
Dear Members I'm new here. Please permit me to ask some newbie question I'm from a non-profit organization, working for gender equality. We wish to get a small message across to sister blogs...
2
1620
by: Chak | last post by:
Newbie question. I think ASP.NET 1.1 forms used POST requests. Does ASP.NET 2 also use POST , or does it use GET ? Thanks.
2
1988
by: Phlip | last post by:
Newsgroupies: One myth about USENET is that each group has a charter; some "official" list of on-topic concepts. When a post arrives "violating" this myth, the replies that support the myth can...
29
2546
by: GhostInAK | last post by:
I'm seeing a terribly distubing number of questions that have no purpose in existing. As an example: How do I change the position of a stream? Hmm.. Could it be some method on the stream...
5
1132
by: Banibrata Dutta | last post by:
Hi, I've gone through the list of "language differences" between 2.3 / 2.4 & 2.5 of CPython. I've spend around 2 weeks now, learning v2.5 of CPython, and I consider myself still very very...
3
2331
Lokean
by: Lokean | last post by:
Sorry for this newbie question, this is not my realm of expertese. I have searched google, tried several applications that claim they can do this, such as Mapforce, which I found confusing, to...
0
7258
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7313
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6970
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5558
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1489
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
366
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.