473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

JavaScript and PHP

Jay
Hi,
How can I get a Javascript var into PHP, on the SAME PAGE.

I would like to get the value of a Javascript var (like
document.myForm.f_name.value) to treat it in PHP.

Many Thanx,
Jay,
France.
Jul 17 '05 #1
5 1549
*** Jay wrote/escribió (Fri, 26 Nov 2004 12:37:35 +0100):
How can I get a Javascript var into PHP, on the SAME PAGE.

I would like to get the value of a Javascript var (like
document.myForm.f_name.value) to treat it in PHP.


PHP is executed first and in a different computer, you can't go back.
What's your exact need?

--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--
Jul 17 '05 #2
Jay <fi*******@easynet.fr> wrote in message news:<41**********************@news.easynet.fr>...
Hi,
How can I get a Javascript var into PHP, on the SAME PAGE.

I would like to get the value of a Javascript var (like
document.myForm.f_name.value) to treat it in PHP.


You have a form, why not to submit it?

In any way, you can send data from JavaScript (client) to PHP (server)
via GET or POST request.
Jul 17 '05 #3
Alvaro G Vicario <al******************@telecomputeronline.com> wrote in message news:<15*****************************@40tude.net>. ..
*** Jay wrote/escribió (Fri, 26 Nov 2004 12:37:35 +0100):
How can I get a Javascript var into PHP, on the SAME PAGE.

I would like to get the value of a Javascript var (like
document.myForm.f_name.value) to treat it in PHP.


PHP is executed first and in a different computer, you can't go back.
What's your exact need?


I think "on the SAME page" is a clue. Typically, when a form is
submitted to the server, the server returns a new page, the browser
loads the new page. Not the same page. Sometimes, this is not nice
to watch.

I assume Jay wants to send a page, have the user submit a form, but
NOT load another page, but stay on the same one.

A hidden iframe can do it.
Jul 17 '05 #4
Jay <fi*******@easynet.fr> wrote in message news:<41**********************@news.easynet.fr>...
Hi,
How can I get a Javascript var into PHP, on the SAME PAGE.

I would like to get the value of a Javascript var (like
document.myForm.f_name.value) to treat it in PHP.


Not sure... Perhaps you're looking for
<http://jibbering.com/2002/4/httprequest.html>

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com
Jul 17 '05 #5
> Hi,
How can I get a Javascript var into PHP, on the SAME PAGE.

I would like to get the value of a Javascript var (like
document.myForm.f_name.value) to treat it in PHP.

why dont just put it to some hidden field of the form?
Jul 17 '05 #6

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

Similar topics

0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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
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...

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.