Search Results

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

Page 166/1708 | < Previous Page | 162 163 164 165 166 167 168 169 170 171 172 173  | Next Page >

  • SWFUpload is it possible to upload multiple files to a single php script execution

    - by user176333
    Hello, I'm trying to implement SWFUpload into an existing PHP upload funcitonality. My current backend script however expects 2 fiels to be uploaded in a single php script execution. (e.g. it excepts the $_FILES parameters to contain 2 entries). So i'm queueing 2 files with SWFUpload and start uploading them. However it appears SWFLUpload calls the php backend script for each queued file. I'd rather modify SWFUpload to send the files with a single backend script execution instead on having to adjust the backend script. Is anyone familiar with this? I've searched various resources (like the SWFUploads docs and forum, but have not found similiar topics. Thanks in advance

    Read the article

  • Can you post data from PHP.

    - by Simon
    I need to post data from PHP to another site. Example: You goto start.com/auto-login-hack (via GET)... then PHP sets the right headers etc. and sends you via POST to 3rdparty.com/login.php with login credentials... I have done this is the past by having an HTML form and an onload script that submits the form to the destination... I don't know enough about headers etc... is this possible... can anyone link an example... by search skills just turned up how to use $_POST... Thanks...

    Read the article

  • Making php-mode Compatible with Emacs 23

    - by Kristopher Johnson
    I am using Emacs 23 and php-mode.el 1.5.0. When I have this in my .emacs: (require 'php-mode) I get this error message when Emacs starts: Warning (initialization): An error occurred while loading `/Users/kdj/.emacs': error: `c-lang-defconst' must be used in a file To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the `--debug-init' option to view a complete error backtrace. If I evaluate (require 'php-mode) after Emacs starts, I don't get any error messages. I found a blog entry which indicates that this problem is specific to Emacs 23 (that is, there is no error with Emacs 22.x), but it doesn't give any solutions. Don't know if this matters, but I'm using Mac OS X, and I built Emacs from the current CVS sources, using ./configure --with-ns. Anybody know what's going on here, and/or how I can fix it?

    Read the article

  • Sort and display directory list alphabetically using opendir() in php

    - by felixthehat
    Hi there, php noob here - I've cobbled together this script to display a list of images from a folder with opendir, but I can't work out how (or where) to sort the array alphabetically <?php // opens images folder if ($handle = opendir('Images')) { while (false !== ($file = readdir($handle))) { // strips files extensions $crap = array(".jpg", ".jpeg", ".JPG", ".JPEG", ".png", ".PNG", ".gif", ".GIF", ".bmp", ".BMP", "_", "-"); $newstring = str_replace($crap, " ", $file ); //asort($file, SORT_NUMERIC); - doesnt work :( // hides folders, writes out ul of images and thumbnails from two folders if ($file != "." && $file != ".." && $file != "index.php" && $file != "Thumbnails") { echo "<li><a href=\"Images/$file\" class=\"thickbox\" rel=\"gallery\" title=\"$newstring\"><img src=\"Images/Thumbnails/$file\" alt=\"$newstring\" width=\"300\" </a></li>\n";} } closedir($handle); } ?> Any advice or pointers would be much appreciated!

    Read the article

  • Parsing a URL - Php Question

    - by Adi Mathur
    I am using the Following code <?php $url = 'http://www.ewwsdf.org/012Q/rhod-05.php?arg=value#anchor'; $parse = parse_url($url); $lnk= "http://".$parse['host'].$parse['path']; echo $lnk; ?> This is giving me the output as http://www.ewwsdf.org/012Q/rhod-05.php How can i modify the code so that i get the output as http://www.ewwsdf.org/012Q/ Just need the Directory name without the file name ( I actually need the link so that i can link up the images which are on the pages, By appending the link behind the image Eg http://www.ewwsdf.org/012Q/hi.jpg )

    Read the article

  • PHP does not return errors at all

    - by ErJab
    I am running PHP and nginx and I use a production version of php.ini. So the variable display_error is set to Off and there is a good reason I want it this way. But for certain files I need to enable error reporting. I used ini_set to turn on error reporting. But a simple code snippet like: <?php error_reporting(E_ALL); ini_set("display_errors", 1); echo "hi"errorrrrr ?> does not trace the error. It simply returns a HTTP 500 Internal Server Error message. What should I do to enable error reporting?

    Read the article

  • JavaScript and PHP filename coding conventions

    - by Tower
    Hi, I would like to know the popular ways of naming files in JavaScript and PHP development. I am working on a JS+PHP system, and I do not know how to name my files. Currently I do for JS: framework/ framework/widget/ framework/widget/TextField.js (Framework.widget.TextField()) Framework.js (Framework()) So, my folders are lowercase and objects CamelCase, but what should I do when the folder/namespace requires more than one word? And what about PHP? jQuery seems to follow: jquery.js jquery.ui.js jquery.plugin-name.js so that it is jquery(\.[a-z0-9-])*\.js but ExtJS follows completely different approach. Douglas Crockford only gives us details about his preference for syntax conventions.

    Read the article

  • cannot edit any php files using specific functions

    - by user458474
    I cannot update any txt files using php. When I write a simple code like the following: <?php // create file pointer $fp = fopen("C:/Users/jj/bob.txt", 'w') or die('Could not open file, or fike does not exist and failed to create.'); $mytext = '<b>hi. This is my test</b>'; // write text to file fwrite($fp, $mytext) or die('Could not write to file.'); $content = file("C:/Users/jj/bob.txt"); // close file fclose($fp); ?> Both files do exist in the folder. I just cannot see any updates on bob.txt. Is this a permission error in windows? It works fine on my laptop at home. I also cannot change the php files on my website, using filezilla.

    Read the article

  • PHP calling PostgreSQL function - type issue?

    - by CitrusTree
    I have a function in PostgreSQL / plpgsql with the following signature: CREATE OR REPLACE FUNCTION user_login(TEXT, TEXT) RETURNS SETOF _get_session AS $$ ... $$ Where _get_session is a view. The function works fine when calling it from phpPgAdmin, however whan I call it from PHP I get the following error: Warning: pg_query() [function.pg-query]: Query failed: ERROR: type "session_ids" does not exist CONTEXT: compile of PL/pgSQL function "user_login" near line 2 in /home/sites/blah.com/index.php on line 69 The DECLARE section of the function contains the following variables: oldSessionId session_ids := $1; newSessionId session_ids := $2; The domain session_ids DOES exist, and other functions which use the same domain work when called from the same script. The PHP is as follows: $query = "SELECT * FROM $dbschema.user_login('$session_old'::TEXT, '$session'::TEXT)"; $result = pg_query($login, $query); I have also tried this using ::session_ids in place of ::TEXT when calling the function, however I recieve the same error. Help :o(

    Read the article

  • Implement functionality in PHP?

    - by Rachel
    How can we Implement Bisect Python functionality in PHP Implement function bisect_left($arr, $item); as a pure-PHP routine to do a binary-bisection search for the position at which to insert $item into $list, maintaining the sort order therein. Assumptions: Assume that $arr is already sorted by whatever comparisons would be yielded by the stock PHP < operator, and that it's indexed on ints. The function should return an int, representing the index within the array at which $item would be inserted to maintain the order of the array. The returned index should be below any elements in $arr equal to $item, i.e., the insertion index should be "to the left" of anything equal to $item. Search routine should not be linear! That is, it should honor the name, and should attempt to find it by iteratively bisecting the list and comparing only around the midpoint.

    Read the article

  • Firefox fails to detect content type set by PHP

    - by Ying
    Hi all, I want a php page to 'display' a pdf. Here is the code: <?php header("Content-type: application/pdf"); readfile('Reportage - Berlin.pdf'); //tried echo(readfile(...)) as well ?> Not very complicated I think, but somehow firefox cant detect that this is a pdf. This works in Safari but in firefox, i get a prompt to download the file, so i get like a pdftest.php file. I know im getting my file because if I rename the extension to pdf, i can open it. This seems too simple! am i missing something?

    Read the article

  • Looking for actively maintained matrix math library for php

    - by Mnebuerquo
    Does anyone know where I might find a PHP matrix math library which is still actively maintained? I need to be able to do the basic matrix operations like reduce, transpose (including non-square matrices), invert, determinant, etc. This question was asked in the past, then closed with no answers. Now I need an answer to the same question. See these links to related questions: http://stackoverflow.com/questions/428473/matrix-artihmetic-in-php http://stackoverflow.com/questions/435074/matrix-arithmetic-in-php-again I was in the process of installing the pear Math_Matrix library when I saw these and realized it wouldn't help me. (Thanks Ben for putting that comment about transpose in your question.) I can code this stuff myself, but I would make me happier to see that there is a library for this somewhere.

    Read the article

  • Changing Base Path In PHP

    - by Joshua
    I need to change the folder that "relative include paths" are based on. I might currently be "in" this folder: C:\ABC\XYZ\123\ZZZ And in this case, the path "../../Source/SomeCode.php" would actually be in this folder: C:\ABC\XYZ\Source And realpath('.') would = 'C:\ABC\XYZ\123\ZZZ'; If however, realpath('.') were "C:\Some\Other\Folder" Then in this case, the path "../../Source/SomeCode.php" would actually be in this folder: C:\Some\Source How do I change what folder is represented by '.' in realpath()? Like this: echo ('BEFORE = '.realpath('.')); // BEFORE = C:\ABC\XYZ\123\ZZZ // Some PHP code here... echo ('AFTER = '.realpath('.')); // AFTER = C:\Some\Other\Folder How can I change the folder represented by '.', as seen by realpath()?

    Read the article

  • Problems with creating XML with DOMDocument in PHP

    - by maralbjo
    The below code is fetched from php.net (http://docs.php.net/manual/en/domdocument.savexml.php). My problem is - it doesn't work. My only output from this is: "Saving all the document: Saving only the title part:". What am I missing here? $doc = new DOMDocument('1.0'); // we want a nice output $doc-formatOutput = true; $root = $doc-createElement('book'); $root = $doc-appendChild($root); $title = $doc-createElement('title'); $title = $root-appendChild($title); $text = $doc-createTextNode('This is the title'); $text = $title-appendChild($text); echo "Saving all the document:\n"; echo $doc-saveXML() . "\n"; echo "Saving only the title part:\n"; echo $doc-saveXML($title);

    Read the article

  • spl_object_hash for PHP < 5.2 (unique ID for object instances)

    - by Rowan
    I'm trying to get unique IDs for object instances in PHP 5+. The function, spl_object_hash() is available from PHP 5.2 but I'm wondering if there's a workaround for older versions. There are a couple of functions in the comments on php.net but they're not working for me. The first (simplified): function spl_object_hash($object){ if (is_object($object)){ return md5((string)$object); } return null; } does not work with native objects (such as DOMDocument), and the second: function spl_object_hash($object){ if (is_object($object)){ ob_start(); var_dump($object); $dump = ob_get_contents(); ob_end_clean(); if (preg_match('/^object\(([a-z0-9_]+)\)\#(\d)+/i', $dump, $match)) { return md5($match[1] . $match[2]); } } return null; } looks like it could be a major performance buster! Does anybody have anything up their sleeve?

    Read the article

  • PHP javascript link id

    - by Jordan Pagaduan
    <?php //connect to database .... //select query .... if(isset($_GET["link"])==false){ echo "sample 1"; }else{ echo "sample 2" ; } ?> <script type="javascript"> function Link(id) { location.href='linktest.php&link='+id; } </script> <html> <input type="button" value="link test" onclick="javascript: Link<?php $row['id']; ?>"> </html> (assumed question) How do I force the onclick event to contain the value of $row['id']?

    Read the article

  • PHP Segmentation fault when started from crond

    - by Jeroen Moors
    Hello, I've a php script that's started each minute from cron. It almost always runs without any problem, except for about 10 times within 24h. The times it fails I get a segmentation fault like: bin/sh: line 1: 21815 Segmentation fault /usr/bin/myscript The number after "line 1:" is always different. I'm running: PHP 5.2.6-1+lenny8 with Suhosin-Patch 0.9.6.2 (cli) (built: Mar 14 2010 08:14:04) Is this a problem with my version of PHP? Is there a way to debug this? I have the feeling it crashes when the server load is high, but there's absolutely no prove for this. Any feedback is welcome!

    Read the article

  • Image manipulation with JQuery and PHP

    - by robertdd
    I want to do some kind of image editor, after I upload more images I want to make a list with all the thumbnails! After, I want to be able to click on one thumb and rotate, duplicate, drag and drop (to change positions of the images), and delete the image. I want all the images to be in a php array. If an image is deleted I want to delete the row from array too. If a image is drag-and-dropped I want to change the position in the array too. Ok, after the user uploads all the images and modifies some of them, how can I make a DONE button to save the positions of the images? For this small project how do you suggest I save the images? (to make a table in mysql and store the names of the images in the database depending on the session id? depending on the IP?) Any suggestions are welcome!

    Read the article

  • parsing raw email in php

    - by Uberfuzzy
    i'm looking for good/working/simple to use php code for parsing raw email into parts. i've written a couple of brute force solutions, but everytime, one small change/header/space/something comes along and my whole parser fails and the project falls apart. and before i get pointed at PEAR/PECL, i need actual code. my host has some screwy config or something, i can never seem to get the .so's to build right. if i do get the .so made, some difference in path/environment/php.ini doesnt always make it available (apache vs cron vs cli) oh, and one last thing, i'm parsing the raw email text, NOT pop3, and NOT imap. its being piped into the php script via a .qmail email redirect. i'm not expecting SOF to write it for me, i'm looking for some tips/starting points on doing it "right". this is one of those "wheel" problems that i know has already been solved.

    Read the article

  • Passing var from php to javascript

    - by marc-andre menard
    I try to do something pretty strait... getting php value to javascript here is the page here is the code.. <script language="javascript"> <?php $imagepath = $_REQUEST["path"]; ?> var whatisthepath = <?php $imagepath; ?> alert (whatisthepath); </script> ALWAYS getting UNDEFINE.... why ?

    Read the article

  • Apache or Nginx for php behind Varnish

    - by Macindy
    We are managing a heavy traffic php site (driven with vbulletin). To get less load I use the cache-proxy varnish. Works very well - with varnish the load was reduced by 50%. But now I am thinking about which webserver to use behind varnish. 90% requests getting to the webserver are php-requests. So is there a difference between apache/mpm-prefork with mod_php and nginx/php-fpm? Is apache perhaps better, because it doesn't have the tcp overhead? Thanks for reply - benchmarks would be great! macindy

    Read the article

  • Some unclear PHP syntax

    - by serhio
    I am a PHP beginner and saw on the forum this PHP expression: $regex = <<<'END' / ( [\x00-\x7F] # single-byte sequences 0xxxxxxx | [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx | [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2 | [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3 ) | ( [\x80-\xBF] ) # invalid byte in range 10000000 - 10111111 | ( [\xC0-\xFF] ) # invalid byte in range 11000000 - 11111111 /x END; Is this code correct? What do these strange (for me) constructions like <<<, 'END', /, /x, and END; mean? I recieve: Parse error: syntax error, unexpected T_SL in /home/vhosts/mysite.com/public_html/mypage.php on line X Thanks

    Read the article

  • radio button value in php

    - by Crash893
    Im trying to make a simple survey in php I have a set of radio buttons on a page called sja.php that sends its to sjamail.php page the problem is that when i go to get $answer = $_POST['ans']; I can't seen to do anything like echo "$answer"; but if i were to throw some logic at it like if ($answer == "ans1") { echo 'Correct'; } else { echo 'Incorrect'; } IT will display correct or incorrect so why is it i can't access the value of the radio button ans?

    Read the article

  • Kohana 3 and CRON always accessing index.php (not following the URI argument)

    - by alex
    OK, I hope this is my last question about CRON jobs and Kohana 3. Note: others are not duplicates, just other problems. Here is my CRON job (setup in cPanel) php /home/user/public_html/index.php --uri=properties/update As per this answer. I have set it up so it emails me the output. It is running every 5 mins. Unfortunately, it always emails me the source of the home page of my site (index.php or /). I can access that URL fine in my browser, i.e. http://www.example.com/properties/update and it works and does it's job correctly. I can tell the Cron is never hitting the script because I have a file logger in place. Would this have anything to do with .htaccess? Has this happened to anyone before, and how did they fix it? Many thanks.

    Read the article

  • php error not displayed

    - by devil eye
    I am new to php ; when ever ther is some error in my script ,the browser do not display error wirh line nymber but displays : Server error The website encountered an error while retrieving "http://localhost/gmailAPP/google-api-php-client/examples/calendar/simple.php". It may be down for maintenance or configured incorrectly. Here are some suggestions: Reload this webpage later. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. It is very difficult to debug the code with out error message and line number .Please help

    Read the article

< Previous Page | 162 163 164 165 166 167 168 169 170 171 172 173  | Next Page >