Search Results

Search found 42698 results on 1708 pages for 'php in array'.

Page 139/1708 | < Previous Page | 135 136 137 138 139 140 141 142 143 144 145 146  | Next Page >

  • handle json request in PHP

    - by wo_shi_ni_ba_ba
    When making an ajax call, when contentType is set to application/json instead of the default x-www-form-urlencoded, server side (in PHP) can't get the post parameters. in the following working example, if I set the contentType to "application/json" in the ajax request, PHP $_POST would be empty. why does this happen? How can I handle a request where contentType is application/json properly in PHP? $.ajax({ cache: false, type: "POST", url: "xxx.php", //contentType: "application/json", processData: true, data: {my_params:123}, success: function(res){ }, complete: function(XMLHttpRequest, text_status) { } });

    Read the article

  • will php/apache ever support multi threading?

    - by fayer
    i mainly focus on the web, i think i will never create desktop applications. so i think it's better for me to focus on typical web languages like php. i know an advantage java has over php is multi threading though. will php ever support this feature in the future? thanks

    Read the article

  • Internet Explorer ignoring PHP setcookie() from CentOS server

    - by Hussein Sabbagh
    In the past we used a windows XAMPP server for an internal website. It worked fine but had some intermittent issues and we decided to move to a LAMP server on CentOS. We made the switch today but it turns out Internet Explorer ignores every attempt I make at saving a cookie. There is no underscore in the URL being used... the URL is actually the same as the one the XAMPP server used, where I was able to save cookies without any problems. It really doesn't make any sense to me, all of the code is the same. The only thing to change is the version of PHP and the server OS. The website works on all other browsers except IE. I can't even make a simple setcookie call. On a blank test page I use setcookie("test", "test", time()+36000, "/"); sleep(5); print_r($_COOKIE); and there is nothing there. Our users can't log into the website because of this and I have no idea what the issue is. If anyone can provide any clues or resolutions I would greatly appreciate it. Obviously the easy answer is to not use IE, but that is not an option in this case.

    Read the article

  • PHP gettext on Windows

    - by Axsuul
    There's some tutorials out there for gettext (w/ Poedit)... unfortunately, it's mostly for a UNIX environment. And even more unfortunate is that I am running my WAMP server on Windows XP (but I am developing for a UNIX environment) and none of the tutorials can get gettext working properly for me. From the man page (http://us3.php.net/manual/en/book.gettext.php), it appears that it's a different process on a Windows environment. I've tried out some of the solutions in the comments but I still can't get it to work! Please, I've spent many hours on this, hopefully someone can point me in the right direction to get this thing to work! (and I'm sure there are others out there who share my frustration). So far with my setup, I'm only getting output "Hello World!" whereas I should be getting the translated string. Here is my setup/code so far: <?php // test.php if (!defined('LC_MESSAGES')) { define('LC_MESSAGES', 6); } $locale = "deu_DEU"; // apparently the locales are different on a WINDOWS platform putenv("LC_ALL=$locale"); setlocale(LC_ALL, $locale); bindtextdomain("greetings", ".\locale"); textdomain("greetings"); echo _("Hello World"); ?> Folder structure root: C:\Program Files\WampServer 2\www test.php: C:\Program Files\WampServer 2\www\site .po: C:\Program Files\WampServer 2\www\site\locale\deu_DEU\LC_MESSAGES\greetings.po .mo: C:\Program Files\WampServer 2\www\site\locale\deu_DEU\LC_MESSAGES\greetings.mo Please advise! Thanks for your time :)

    Read the article

  • [AS3] Calling Php Script with UTF-8 POST variables

    - by kornelijepetak
    AS3 documentation says that Strings in AS3 are in UTF-16 format. There is a textbox on a Flash Clip where user can type some data. When a button is clicked, I want this data to be sent to a php script. I have everything set up, but it seems that the PHP script gets the data in UTF-16 format. The data in the database (which is utf-8) shows some unrecognizable characters (where special characters are used), meaning that the data has not been sent in a correct encoding. var variables:URLVariables=new URLVariables; var varSend:URLRequest=new URLRequest("http://website.com/systematic/accept.php"); varSend.method=URLRequestMethod.POST; varSend.data=variables; var varLoader:URLLoader=new URLLoader; varLoader.dataFormat=URLLoaderDataFormat.VARIABLES; varLoader.addEventListener(Event.COMPLETE, completeHandler); When submit button is clicked, the following handler gets executed. function sendData(event:MouseEvent) : void { // i guess here is the problem (tbName.text is UTF-16) variables.name = tbName.text; varLoader.load(varSend); } Is there any way to send the data so that PHP script gets the data in UTF-8 format? (PHP script is retrieving the value using the $_POST['name']).

    Read the article

  • php script request frequently specific web page

    - by Alaa
    i need php script running on my server frequently request a web page i thought of php header, with meta tag (refresh) but that's will not success, because header will redirect me once to the url then the refresh will stop. <?php header('Location: http://www.example.com/'); ?> <html> <META HTTP-EQUIV=Refresh CONTENT="60"> </html> any suggestion please;

    Read the article

  • Why does _GET in PHP wrongly decodes slash?

    - by Boaz
    Hi, Today I run into some oddity with PHP, which I fail find a proper explanation for in the documentation. Consider the following code: <?php echo $_GET['t']. PHP_EOL; ?> The code is simple - it takes a single t parameter on the url and outputs it back. So if you call it with test.php?t=%5Ca (%5c is a '\'), I expected to see: \a However, this is what I got: $ curl http://localhost/~boaz/test.php?t=%5Ca \\a Notice the double slash. Can anyone explains what's going on and give recipe for retrieving the strings as it was supplied on the URL? Thanks, Boaz

    Read the article

  • Redis - which PHP module to use?

    - by Patrick
    If i check redis php supported language (http://code.google.com/p/redis/wiki/SupportedLanguages), there's 4 PHP ones: Redis PHP Bindings,phpredis,Predis,Redisent. Question is, which is the best and good to use? Thanks!

    Read the article

  • PHP sessions dying in a few seconds

    - by beauchette
    I have a problem with my server : my sessions are dying on their own after a few seconds. here are two page examples : page1.php : <? session_start(); $_SESSION['x'] = 'moo'; ?> page2.php : <? session_start(); echo $_SESSION['x']; ?> php's settings are debian's untouched : no auto start, 1440 seconds maxlifetime, etc so, if I visit page1.php et then page2.php I'm supposed to see 'moo' for 24 minutes, in my case, you have 'moo' for about 5 seconds. Then I observed that the actual session file, was 44 bytes long, and then 0 a few seconds later, without any other intervention than a few 'ls' to observe the phenomenon, I really have no clue as to what happens and any help would be appreciated. EDIT: after some fiddling (mainly not doing much besides restarting my server 3 or 4 times) I was able to have my quick example working. and then I noticed that sessions in my session.save_path directory are all 44 bytes except for some that are 0 bytes, so it's like it's working but not always. which is even more frustrating.

    Read the article

  • jquery $.post returned data from php is empty

    - by vee
    hi, i'm using this code to post to a php page: var qreq = ".....myurl.php"; $.post(qreq, function(data){alert(data);}); in my PHP file i have this: ...... $prevtopic = $row["topic_id"]; echo $prevtopic; the alert comes up, but is blank. for some reason data is empty even though i'm echoing from the PHP file. i also tried just echoing "hi" but that didn't work either. what am i doing wrong? thanks.

    Read the article

  • php Dollar amount Regular Expression

    - by Thildemar
    I am have completed javascript validation of a form using Regular Expressions and am now working on redundant verification server-side using PHP. I have copied this regular expression from my jscript code that finds dollar values, and reformed it to a PHP friendly format: /\$?((\d{1,3}(,\d{3})*)|(\d+))(\.\d{2})?$/ Specifically: if (preg_match("/\$?((\d{1,3}(,\d{3})*)|(\d+))(\.\d{2})?$/", $_POST["cost"])){} While the expression works great in javascript I get : Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 1 when I run it in PHP. Anyone have a clue why this error is coming up?

    Read the article

  • where are wrong in my php code ????

    - by user318068
    hi all, <td align="center" bgcolor="#FFFFFF"><?php echo '<label onclick="window.open('profilephp.php?member=$row['MemberID']','mywindow')">'.{$row['MemberName']}.'</label>';?><br /> <?php echo "<p align='center'><img width='100' height='100' src={$row['MemberImg']} alt='' /></p>";?></td></tr> Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\home - Copy\membercopy.php on line 141 I really don't know where it went wrong. Please help,

    Read the article

  • Hide URL of PHP page

    - by manoj singhal
    I want to hide the URL of my PHP page; that is, I don't want to write /register.php directly in the href tag, I want to write /register/ and have it open the register.php page directly. I want to do that for all the webpages.

    Read the article

  • PHP - print content from file after manipulation

    - by ludicco
    Hello there, I'm struggling trying to read a php file inside a php and do some manipulation..after that have the content as a string, but when I try to output that with echo or print all the php tags are literally included on the file. so here is my code: function compilePage($page,$path){ $contents = array(); $menu = getMenuFor($page); $file = file_get_contents($path); array_push($contents,$menu); array_push($contents,$file); return implode("\n",$contents); } and this will return a string like <div id="content> <h2>Here is my title</h2> <p><? echo "my body text"; ?></p> </div> but this will print exactly the content above not compiling the php on it. So, how can I render this "compilePage" making sure it returns a compiled php result and not just a plain text? Thanks in advance

    Read the article

  • jQuery ajax request to php, how to return plain text only

    - by jyoseph
    I am making an ajax request to a php page and I cannot for the life of me get it to just return plain text. $.ajax({ type: 'GET', url: '/shipping/test.php', cache: false, dataType: 'text', data: myData, success: function(data){ console.log(data) } }); in test.php I am including this script to get UPS rates. I am then calling the function with $rate = ups($dest_zip,$service,$weight,$length,$width,$height); I am doing echo $rate; at the bottom of test.php. When viewed in a browser shows the rate, that's great. But when I request the page via ajax I get a bunch of XML. Pastie here: http://pastie.org/1416142 My question is, how do I get it so I can just return the plain text string from the ajax call, where the result data will be a number? Edit, here's what I see in Firebug- Response tab: HTML tab:

    Read the article

  • PHP - Read TXT from specific position

    - by user1466766
    I'm having trouble with PHP text parsing I have a txt file which has this kind of information: sometext::sometext.0 = INTEGER: 254 What i need is to get the last value of 254 as variable in PHP. in this txt file this last value can change from 0 to 255 "sometext::sometext.0 = INTEGER: " this part doesn't change at all. It has a length of 36 symbols, so i need get with PHP what is after 36 symbol into variable. Thank you.

    Read the article

  • Define an empty array in Perl class new()

    - by Laimoncijus
    Hi, I am just beginner with Perl, so if it sounds stupid - sorry for that :) My problem is - I am trying to write a class, which has an empty array, defined in constructor of a class. So I am doing this like this: package MyClass; use strict; sub new { my ($C) = @_; my $self = { items => () }; bless $self, ref $C || $C; } sub get { return $_[0]->{items}; } 1; Later I am testing my class with simple script: use strict; use Data::Dumper; use MyClass; my $o = MyClass->new(); my @items = $o->get(); print "length = ", scalar(@items), "\n", Dumper(@items); And while running the script I get following: $ perl my_test.pl length = 1 $VAR1 = undef; Why am I doing wrong what causes that I get my items array filled with undef? Maybe someone could show me example how the class would need to be defined so I would not get any default values in my array? Thanks!

    Read the article

  • PHP getting blank pages after submit a form + signal Segmentation fault (11)

    - by Ole Media
    I few days ago I update my macbook pro to snow leopard, and since then some php files are not showing. This is what happens: I created a php form, when going to 'http://localhost/webform.php' I can see the form just fine. Then, once I submit the form, I just get a blank page. I enable error and warnings reporting under php.ini to make sure I'm not missing something, but still I'm not getting anything, just the blank page. Then I checked under apache log files, and what I notice is that every time I submit the form I see the following line coming up under the apache logs: [Wed Apr 07 21:40:28 2010] [notice] child pid 70223 exit signal Segmentation fault (11) I'm clueless on this one. Any ideas on how to fix it?

    Read the article

  • Nginx: Loopback connection via PHP's getimage size crashes server (Magento's CMS)

    - by Alex
    We were able to trace down a problem that is crashing our NGINX server running Magento until the following point: Background info: Magento Backend has a CMS function with a WYSIWYG editor. This editor loads some pictures via a controller in magento (cms/directive). When we set the NGINX error_log level to info, we get the following lines (line break inserted for better readability): 2012/10/22 18:05:40 [info] 14105#0: *1 client closed prematurely connection, so upstream connection is closed too while sending request to upstream, client: XXXXXXXXX, server: test.local, request: "GET index.php/admin/cms_wysiwyg/directive/___directive/BASEENCODEDIMAGEURL,,/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9024", host: "test.local" When checking the code in the debugger, the following call does never return (in ´Varien_Image_Adapter_Abstract::getMimeType()` # $this->_fileName is http://test.local/skin/adminhtml/base/default/images/demo-image-not-existing.gif` # $_SERVER['REQUEST_URI'] = http://test.local/admin/cms_wysiwyg/directive/___directive/BASEENCODEDIMAGEURL list($this->_imageSrcWidth, $this->_imageSrcHeight, $this->_fileType, ) = getimagesize($this->_fileName); The filename requests is an URL to the same server which is requesting the script a link to a static .gif that is not existing. Sample URL: http://test.local/skin/adminhtml/base/default/images/demo-image-not-existing.gif When the above line executed, any subsequent request to the NGNIX server does not respond any more. After waiting for around 10 minutes, the NGINX server starts answering requests again. I tried to reproduce the error with a simple test script that only calls getimagesize() with the given URL - but this not crash. It simple leads to an exception saying that the URL could not be loaded (which is fine as the URL is wrong)

    Read the article

  • How to get session variables from php server with Ajax function? (PHP HTML JS Ajax)

    - by Ole Jak
    so in my php I have something like this $_SESSION['opened'] = true; But It will not be set to true until user will perform some actions with some other html\php pages So I need on some Ajax function to be able get this session variable. And some PHP sample of function to get variable in form ready for Ajax to get it. so I need something to AJAX requesting to an action (to some simple php code) which will return a value from $_SESSION. How to do such thing?

    Read the article

  • Druapl & Regular PHP Integration

    - by user333128
    I'm building a new website which has one core application and many content pages. Content pages are mostly dynamic and I require a way to manage this dynamic content on a regular basis. The core application's main functionality is a 3 step process or reading user data (input page), reading data from MySQL (product page) and submitting an application to an email address (application page). Ideally I would like to build the core application in regular PHP and leverage Drupal for its content management capabilities. Can Drupal and regular PHP be integrated as I suggest easily? My feeling is that coding the core application as a Drupal module(s) will add layers of complexity that could be difficult to code from the outset and maintain later on as the system matures - so I would really like to just use regular PHP. Let me explain where dynamic content (managed by the CMS) intersects with the core application: Dynamic content such as FAQ data is used both on the 'normal' help pages and also within a mini-feed displayed within core application pages down a right hand side column. In this column, 3 random questions are pulled from the database and displayed as a feed. When users click on FAQ question they are not taken away from the core application product page but are instead shown data in a pop-up window displaying the question and answer. In addition, users can browse other questions and answers through a simple navigation menu within this popup. There are 3 such like feeds as I describe above that I require on the core application product page. So, what is the ideal solution here in terms of 'keeping things simple' for both the management of dynamic content and the ease of coding the core application? Can 'regular PHP' and Drupal co-exist 'peacefully'? If so, how is this technically possible? Because there is some content managed by Drupal contained within core application pages, can the core application still be coded in regular PHP? Any advice / suggestions? Thank you! Jim.

    Read the article

< Previous Page | 135 136 137 138 139 140 141 142 143 144 145 146  | Next Page >