Sending Additional Parameters In JSON String To JqGrid

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;
<~SNIP~>
echo json_encode($response);

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

[CODE....]

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



ADVERTISEMENT

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]);

[Code].....

View 4 Replies View Related

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 View Related

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",
[code]...

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 View Related

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:
SMTP = URL
where user is my "user" name and "smtpserver" is my outgoing mail server.

But all this doesn't work.
The following error message appear:
SERVER ERROR
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 View Related

Pass Additional Parameters To Register_shutdown_function()?

pass Additional Parameters to register_shutdown_function()?

View 13 Replies View Related

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();" />
</form>

Upload.php script looks like this:

<?php
$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 View Related

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 View Related

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();
[code]....

View 3 Replies View Related

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 View Related

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 View Related

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">
</form>

Why is it that the querystring on testz.php looks like:
http://localhost/php/testz.php?

I know it's probably something easy...

View 4 Replies View Related

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))
[code]....

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);
[code]............

View 3 Replies View Related

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'),
);

[Code]...

View 2 Replies View Related

Sending Parameters With Include/require

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

include('file.php?cod=5');

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

What to do?

View 2 Replies View Related

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='http://page.net/Webservice/'><Userid>".$username."</Userid><Password>".$password."</Password></UserCredentials>";
$client->setHeaders($session_header);

[Code]....

View 2 Replies View Related

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:

while($e=mysql_fetch_assoc($q))
$output[]=$e;
$zip = new ZipArchive();
$zip->addFromString("test",(json_encode($output)));
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 View Related

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 View Related

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!!

<?php
//recieve the image
$media = json_decode($_POST['media']);
header('content-type: image/jpeg');
$image = imagecreatefromjpeg($media);
imagefilter($image,IMG_FILTER_GRAYSCALE);
imagefilter($image,IMG_FILTER_COLORIZE,100,50,0);
imagejpeg($image, '', 90);............

View 4 Replies View Related

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.

$('.fresh_start')
.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 View Related

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(

[code]...

View 2 Replies View Related

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'

[code]....

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 View Related

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 View Related

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);

[Code].....

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 View Related

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
NSLog(@"%@",content);
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 ?
[Code]....

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 View Related

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 View Related

Functions Can Recognize My Global Variables Without Sending These Variables As Parameters In The Function Headers?

If I define a variable $var, and then define a function Func(), then I can't use the variable $var inside the function because the variable is defined outside the function. If I want to use the variable $var inside the function, then I have to send it as a parameter in the function header like this, Func($var).

But the problem is that I have many global variables, and many function. I don't want to pass all these variables to all the functions! Isn't there a way that the functions can recognize my global variables without sending these variables as parameters in the function headers?

View 7 Replies View Related

Sending Two Reference Variables As $_GET Parameters - When The Next Page Loads, The $_GET Values Aren't There?

I have an initial redirect page which directs to my main page, sending two reference variables as $_GET parameters:

Code: [Select]header("Location: /ob/index.php?id=".$id."&ref=".$ref);
The first thing this main page does is include a file which checks for those two values:

Code: [Select]if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start();
session_start();
error_reporting(E_ALL);

[code]....

The main page loads fine - meaning that the $_SESSION variables have been set correctly. However, when the next page loads (including the same file), the $_GET values obviously aren't there but the $_SESSION variables should be intact. I am getting fails every time though in Opera and Safari (have checked in IE, FF and Chrome and all seems well).However, if I then refresh the browser - in both Opera and Safari - the next page loads fine and the $_SESSION variables are correctly set.

View 6 Replies View Related

Remove Parameters In An Url String?

I have a string that looks like this, like a URL that has parameters.

folder/tested/file.js?p1=v1&p2=v2

How can I manipulate this string so as to remove all params, so that it ends up looking like this

folder/tested/file.js

View 6 Replies View Related

Get $_GET Parameters String As Written In The URL?

I'm trying to redirect from one page to another while retaining the parameters.

e.g. if I have a page page.php?param1=1&param2=2, what's the easiest way to extract "param1=1&param2=2"?

View 4 Replies View Related

Manipulate Url String By Adding GET Parameters?

I want to add GET parameters to urls that may and may not contain GET parameters without repeating ? or &.

Example:

If i want to add category=action

$url="http://www.acme.com"; // will add ?category=action at the end
$url="http://www.acme.com/movies?sort=popular"; // will add &category=action at the end

If you notice i'm trying to not repeat the question mark if it's found.

The url is just a string.

What a reliable function to append a specific GET parameter?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved