473,664 Members | 3,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP-JSON

Hi all,

Can anyone explain how to use JSON (JavaScript Object Notation) with
php and post a sample, or any good site that has.

Thanks

Jul 17 '05 #1
5 2929
Found this. Seems simple enough.

http://mike.teczno.com/JSON/READ-ME-JSON.phps

-aaron

Jul 17 '05 #2
I've found that sample too and i can convert my data into json format i
just don't get how to send it and get new data with it.

I'm trying to do something like;

With one page, at first show the login page for example. After the
user enters information like username and password, query the database
and return a result that the information is valid and when it is valid
show the user the main menu at the same page without refreshing the
page.

It can be done with json i think but my problem is how to pass the data
to another page and get a new data without refreshing.

Jul 17 '05 #3
I'm not sure about doing this without refreshing. You could probably
use frames and not reload the frame that holds your form (kind of like
gmail uses). Of course, this would require a lot of javascripting.

JSON is just a format in which to transfer data. It is written so that
the eval() function in javascript can handle the data very easily. If
you're querying a database (which is server side), I don't think that
javascript (client side) will play a large role.

Does this project require the page not be refreshed?

Jul 17 '05 #4
On 24 May 2005 01:18:38 -0700, "Botan Guner" <bo*********@gm ail.com> wrote:
I've found that sample too and i can convert my data into json format i
just don't get how to send it and get new data with it.

I'm trying to do something like;

With one page, at first show the login page for example. After the
user enters information like username and password, query the database
and return a result that the information is valid and when it is valid
show the user the main menu at the same page without refreshing the
page.

It can be done with json i think but my problem is how to pass the data
to another page and get a new data without refreshing.


JSON is a format typically used in conjunction with XMLHTTPRequest Javascript
objects, which let you retrieve data in Javascript in response to user actions,
without a complete page refresh.

Also search for "Ajax" which is the currently fashionable name for joining
together the various techniques involved.

--
Andy Hassall / <an**@andyh.co. uk> / <http://www.andyh.co.uk >
<http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #5
Thanx all, i've found what i was looking for. it was XMLHttpRequest not
JSON... any way wrong question but true answer came.

Jul 17 '05 #6

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

Similar topics

3
4038
by: lawrence | last post by:
I haven't been able to reach www.php.net for days. Most of the rest of the web is working for me, though I've bad trouble reaching any English sites. Anyone else having trouble?
9
2641
by: Bartosz Wegrzyn | last post by:
I need help with sessions. I createt set of web site for nav with authorization. first I go into main.php which looks like this: <?php //common functions include_once '../login/common.php'; global $LOGINDIR;
4
2713
by: Japhy | last post by:
Hello, I'm am pulling data from a mysql db and want to use the data to populate a <ul. Here are relavent parts of my code : $wohdate = mysql_result($wohRS,$wohndx,woh_date); $woh_display .="<li>".$wohdate."</li>" ; $TemplateText = Replace($TemplateText,"@$wohdisplayndx@",$woh_display);
3
7481
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work on her local machine. Everything looks pretty good. OpenLDAP/cygwin works great. PostgreSQL works great. Apache runs. PHP runs. But when I try to connect to my PostgreSQL server using PHPPgAdmin, I
59
6981
by: Lennart Björk | last post by:
Hi All, I have a tiny program: <!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>MyTitle</title> <meta http-equiv="Content-Type" content="text/html;
1
6476
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem to be having an effect? ...
1
2636
by: ansc1 | last post by:
Hello, I'm new to using php coding. I need help with the following: 1. There is a submit button on the form and is saves information to my database. After clicking on "Save Measurement" it redirects me to another page in my site. What I would like to do is change what page directs it to. Currently the submit button redirects me to page /measure/men_measure. I would like to be able to change this. Please see below my page below:...
0
1671
by: tsivaraman | last post by:
I am trying to build php-5.2.1 in RedHat Linux 9. I have installed libxml2-2.6.11,mysql-5.0.33,httpd-2.2.4(apache) successfully.When i do 'make' from the php directory,i get the following errors..Not able to proceed further.(./configure went smooth). I request you to provide suggestions to solve this problem. -5.2.1/include -I/lamp/php-5.2.1/main -I/lamp/php-5.2.1 -I/usr/local/ include/libxml2 -I/lamp/php-5.2.1/ext/date/lib...
0
2745
by: Benjamin Grieshaber | last post by:
Hi, I´m on SuSE 9.3 with xmlrpc-c and xmlrpc-c-devel installed (ver. 0.9.10) I tried to compile php with xmlrpc support and got the following errors: ext/xmlrpc/.libs/xmlrpc-epi-php.o(.text+0x359): In function `set_zval_xmlrpc_type': /php-5.2.5/ext/xmlrpc/xmlrpc-epi-php.c:1313: undefined reference to `XMLRPC_CreateValueDateTime_ISO8601'
4
4367
by: mechphisto | last post by:
I'm working on a friend's box, Fedora Core 6. It has PHP 5.1.6. I need to install mcrypt into it, and the only way I can find to do it is from source then recompile PHP. So I did all that, and got the latest PHP, 5.2.5. The ./configure finally went through OK. Make and make install. Then I restarted Apache... but the phpinfo() shows no change. It's still using 5.1.6. When I run "php -v" from command line I get a huge error I'll include...
0
8437
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8861
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8778
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4185
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2764
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 we have to send another system
2
2003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1759
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.