Sending Additional Parameters In JSON String To JqGrid

Mar 3, 2011

I'm using PHP to generate JSON for JQGrid. I've added another property to the PHP object that I'm JSON encoding:

$sql_array = preg_split('/LIMIT/', $sql);
$pass_sql = $sql_array[0];
$response->sql = $pass_sql;
echo json_encode($response);

This parses fine on the client side and populates the jqGrid with JSON like this:


I need to pull that sql param text out of the JSON reply and hide it in a DIV for later. Is this possible?

View 1 Replies


Sending Additional Curlopt Parameters Using Curl?

how to send additional curlopt parameters using curl if this params are taken from textarea or text file

PHP Code:

$new_array = explode('|', $_POST['text']);
for ($new_array_c=0; $new_array_c<sizeof($new_array); $new_array_c++)
$new_array[$new_array_c] = explode(' = ', $new_array[$new_array_c]);
$new_array_01[$new_array_c] = trim($new_array[$new_array_c][0]);


View 4 Replies

Jqgrid: Get Value From Json Data

how can I get return value from json string?

how can I parse and read the variable searchxx?

from php:
$responce->page = $page;
$responce->total = $total_pages;
$responce->records = $BC->tot_count;
$responce->searchxx = $sSchWhere;
$responce->order = $sOrder;

while ($data) ......

echo json_encode($responce);

from html(firebug)

"page":"1","total":2,"records":"26","searchxx":"T0.NAME=pluto" ,"order":"T0.NAME desc","rows":[{"id":"63025c7a-12ad-102c-bd62-005056801340","account_id":"c30c7934-e0f3-102b-8fd4-005056801340","actions":"","edtNAME":"Rossi Mario","edtACCOUNT_NAME":"Rossi Mario</a>","edtAREA":"DEMO","edtSTATUS":"Aperta","edtPRIORITY" ......ecc.

View 3 Replies

Cannot Import Json Data Into A JQgrid?

I cannot import my json data into a jQgrid. I get an empty grid. I hope someone has a solution. The json data seems to be improperly formated.

It looks like this:
{"total": "3",

Get the jSon to format properly (i.e, what jQgrid expects)Configure jSonReader to handle my jSonI will try and report back on any suggestions given to me.

View 1 Replies

Additional Parameters To Configurer PHP.INI With PWS

Are there additional parameters that I can put in the PHP.INI file with PWS?

In this file I write, such as the HELP specifies, in the following line:
SMTP = me@localhost
and I've replace with the following:
where user is my "user" name and "smtpserver" is my outgoing mail server.

But all this doesn't work.
The following error message appear:
and the number of the line where exactly is located the function mail().

I've wrote this function correctly.
But I think the problem is the configuration in the PHP.INI file.
May be, I need to write the user name or the password in this file?

View 1 Replies

Pass Additional Parameters To Register_shutdown_function()?

pass Additional Parameters to register_shutdown_function()?

View 13 Replies

Send Additional Parameters When Uploading A File?

I am initializing file upload using the following HTML:

<form enctype="multipart/form-data" action="PHPScripts/upload.php" method="POST">
<input type="file" id="browseButton" name="image" onchange="this.form.submit();" />

Upload.php script looks like this:

$file = $_FILES["image"];
$filepath = $file["name"];
$filetmp = $file["tmp_name"];
$filesize = $file["size"];
$filename = basename($filepath);
$filetype = substr($filename, strrpos($filename, ".") + 1);

I need to pass one more parameter to my php script, but I don't know how. HTTP method is POST (as can be seen in the code above), but where should I put the parameter? Is that even possible?

View 2 Replies

Pass Additional Parameters To The Zend PartialLoop View Helper?

In a Zend view I can apply a partial template to an iterable element as follows:

$this->partialLoop('template.phtml', $iterable);

However inside the template, only the elements of the $iterable are available, is there another way of passing extra data to the partial?

View 2 Replies

Add Additional Objects To JSON Encoded Array?

I am currently using a JSON encoded array to display the users in my database for an auto-suggest feature.It looks something like this:

$sth = mysql_query("SELECT id, name FROM users");
$json = array();

View 3 Replies

Get The Entire Row Data From JqGrid When Click The Link In Same Row Using JQgrid?

I am new to JQgrid and am unsure how to handle this use case.When a user clicks on a link in a specific row in jQgrid I need to get the row data with a separator.

View 2 Replies

Sending Additional Post Data To Server With Uploadify?

I'm using uploadify on a page that allows a user to upload images as well as a category field in which to send those images. Now, I see that uploadify provides a "scriptData" method that allows me to send over key value pairs to the uploadify.php script. But the problem is that the scriptData method grabs its values upon page load(uploadify initialization). Thus when a user is on the page changing values, scriptData still only has the default values that were there on page load.Is there anyway around this?Possible solution: I was reading the manual further and discovered that you can change the settings through a function call. Possibly on the right track?

$('#fileInput').uploadifySettings('scriptData', getKeyValuePairs()).uploadifyUpload();

View 2 Replies

Form Not Sending Parameters?

my previous post was a bit premature. I've narrowed my
problem down to this:

I have this very simple form in test1.php

<form name='formx6' action="testz.php?varxy=1">
<input type="text">
<input type="submit" value="sub">

Why is it that the querystring on testz.php looks like:

I know it's probably something easy...

View 4 Replies

Remove Additional </html> Tag From String Using Regular Expression?

I am using php DOMDocument to replace a node and then rewrite the page. The HTML that is written back is plain text (not HTML) so I had to convert it like so:

$content = files::readFile($data['page_path']);
$content = str_replace('&lt;', '<', $content);
$content = str_replace('&gt;', '>', $content);
if (!@fwrite($handle, $content))

This makes the HTML proper however, for some odd reason, it adds an extra < / html > tag to the bottom of the document with some additional data after the offending < / html > tag. I am at a total loss as to why.Anyway, I thought about using:

$content = preg_replace('#</head>*(:alphanum:)#', '</html>', $content);

View 3 Replies

Adding Additional String Or Caption To Random Images?

I have this very short script I wrote with help from a book using arrays and the rand function. Basically it changes the images randomly on browser load or refresh.However, I am trying to add an additional, not sure what to call it, a string or another caption for each images. Instead of this being a caption, it will be a link, so a link will appear under each caption that goes to another page when it is clicked on.

I tried adding another caption and adding a like to it but getting syntax error.

Here is the code: Code: [Select]<?php
$images = array(
array('file' => 'image1',
'caption' => 'Caption 1'),
array('file' => 'image2',
'caption' => 'Caption 2'),


View 2 Replies

Sending Parameters With Include/require

I want to send some parameters to an included php script.


And gives me an error, that file.php?cod=5 not found.

What to do?

View 2 Replies

Sending Parameters To A Webservice Via Url And Getting Response?

I know how obtain info from a webservice: connecting (sending url, user and pass) and calling a method passing parameters to it using nusoap. Here's and example:

$client = new nusoap_client($webServiceURL, 'wsdl', $proxyhost, $proxyport, $proxyusername, $proxypassword);
$session_header = "<UserCredentials xmlns=''><Userid>".$username."</Userid><Password>".$password."</Password></UserCredentials>";


View 2 Replies

Zip A JSON Object Before Sending?

I'm interested in zipping the text output from a JSON object on a server before transporting it to my mobile device that has requested the object. A small test of the txt zipping will reduce its size by about 80%! This is great for mobile! :)

I don't really need to save the zip file i create on the server at all, just have it reside in memory, then echo it out. I can unzip it on the android side no problem.

Anyways, I've done a little manipulation but I haven't been able to come up with anything that works, here's what I have so far:

$zip = new ZipArchive();
echo $zip;

My $q is a cursor containing lots of sql rows, and if I use print(json_encode($output)); instead of all the zip shenanigans it works fine to output the raw text.

View 1 Replies

Sending JSON Via Httppost In Java?

I'm working on a school project, which requires JAVA to send a series of barcodes to a php web service front end. I've looked at a couple of posts here and here,and taken something from them, but my code doesn't seem to work.So here's my JAVA code:

import org.json.simple.JSONObject;
import org.apache.http.client.HttpClient;
import org.apache.http.client.ResponseHandler;[code]....

The problem is, in log file log.txt, every time I run the JAVA program, it only adds a new line consisting time and date. To me, this means that php is picking up that there was a httppost request, but where is my json string?

View 1 Replies

Sending An Image And Return It Using Json?

im trying to send image to a webservice in php using json, but the client cnt read the image..
when i return it back!!

//recieve the image
$media = json_decode($_POST['media']);
header('content-type: image/jpeg');
$image = imagecreatefromjpeg($media);
imagejpeg($image, '', 90);............

View 4 Replies

Sending Json Data Using Jquery?

I have a small doubt. I am trying to send json data to my back end page like this. But i am getting error. where in only $fb_list1 is json data. So how do i send it from here.

.html("<div class='response1'><img src='/images/preloader.gif' alt='Loading.....'></img></div>")
.load('abc.php',{product:'lcd',type:'product_display',fb_list:"<?php echo $fb_list1 ?>"});

View 1 Replies

Decoding JSON After Sending Using CUrl?

I've researched everywhere and cannot figure this out.I am writing a test cUrl request to test my REST service:

// initialize curl handler
$ch = curl_init();
$data = array(


View 2 Replies

Sending JSON From JavaScript With AJAX?

I have an AJAX function which calls a PHP page. That page returns a JSON object, which should then be parsed and displayed to the user. Everything works fine except when the JSON object is returned, trying to parse it gives undefined.

The PHP:

$jsonArray= array(
'request' => 'this is the request',
'response' => 'this is the response'


On the Ajax side, I do the following:

var display=xmlHttp.responseText;
alert(display); //gives {"request":"this is the request","response":"This is the response"}
alert(display.request); //gives undefined

Am I missing something obvious? Pasting the same string directly into a JavaScript variable seems to work fine...

View 3 Replies

Sending Large JSON Data From Server?

I am sending large datasets in JSON format from my server (using PHP). I want to keep bandwidth costs down. I am wondering:

should I gzip compress the JSON data server side before sending the data? is there a javascript gzip uncompression library?

View 4 Replies

Sending Arguments To Drupal Views (JSON, CURL)

I'm trying to retrieve a view with the (Node)Date Created argument. However I don't seem to be able to get it to work right, when I send it though cURL. Here is my code:

$method = 'views.get';
$hash = hash_hmac('sha256', $timestamp .';'.$domain .';'. $nonce .';'. $method, $api_key);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);


I'm guessing its processing args somehow, as it returns [] with that, and when I remove 'args' =>.... it runs with the wildcard setting.

View 1 Replies

Objective C - More Specific About Sending Json With Utf8 To Iphone From Server?

We have php server that sends json string in utf-8 encoding. Im responsible for the iphone app that get the data. I want to be sure that on my side everything is correct :

//after I downlad the data stream :
NSString* content = [[NSString alloc] initWithData:self.m_dataToParse encoding:NSUTF8StringEncoding];
//here the data is shown correctly in the console
SBJsonParser *_parser = [[SBJsonParser alloc]init];
NSDictionary *jsonContentDictionary = [_parser objectWithData:self.m_dataToParse];
//here, when i printer values of array IN array, i see u454 u545 4545 format. any ideas why ?

im using the latest version of json library : [URL] There is problem is the iphone side? (json parser? ) or in the php server?

just to be clear again :
1.on the console, before json, the string looks o.k
2.after doing json, the array in array values are in the format of u545 u453 u545

View 1 Replies

Problem With Sending Json Encoded Data Via Ajax To A Php Script (internationalization)

I am using javascript to collect the user input from a form, put it in
an object, json encode it (using JSON or YUI JSON), use the YUI
connection manager (XMLHTTPRequest) to send it to a PHP script for
validation after a json_decode; result an associative array. The
webpage (valid XHTML), the PHP script, the Apache webserver, the mysql...

View 6 Replies

Copyrights 2005-15, All rights reserved