Search Results

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

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

  • apostrophe in mysql/php

    - by fusion
    i'm trying to learn php/mysql. inserting data into mysql works fine but inserting those with apostrophe is generating an error. i tried using mysql_real_escape_string, yet this doesn't work. would appreciate any help. <?php include 'config.php'; echo "Connected <br />"; $auth = $_POST['author']; $quo = $_POST['quote']; $author = mysql_real_escape_string($auth); $quote = mysql_real_escape_string($quo); //************************** //inserting data $sql="INSERT INTO Quotes (vauthor, cquotes) VALUES ($author, $quote)"; if (!mysql_query($sql,$conn)) { die('Error: ' . mysql_error()); } echo "1 record added"; ... what am i doing wrong?

    Read the article

  • PHP Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION

    - by Douglas Santos Pinto
    PHP Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in C:\Inetpub\wwwroot\webroot\www.novotempo.org.br\lib\Twitter.php on line 54 Hi, I´m Douglas from Brazil, and this above is my problem. The line is just a DEFINE.... this one : define('DEBUG',false); Searching the net I found that this usually occurs when you´re using PHP 4.xx, but I´m using 5.2.6 (Just saw it using phpinfo()) I tryed locally, and in two other external hosts, but it keeps returning the same msg. Anyone can help? Tanx! Doug

    Read the article

  • Help installing Zorba (XQUERY) PHP Extension on windows

    - by Davey
    Hi, I'm trying to install zorba php extension on windows and I am having all sorts of problems. I have installed the zorba binaries on my computer, but when I try to install the PECL package (pecl install zorba-alpha) I get the following error "ERROR: the DSP zorba.dsp does not exist". I've tried searching for zorba_api.dll or zorba_api.so in order to just bypass the pecl install process, but no luck. If anyone can tell me how to get the zorba extension installed on my windows php I will be eternally grateful. Alternately, if someone knows of another xquery solution for PHP that I can install, I will be equally excited and appreciative. Thank you! Davey

    Read the article

  • Using PHP/MySQL with Google Maps

    - by Anders Kitson
    Hiya, I followed this tutorial below http://code.google.com/apis/maps/articles/phpsqlajax_v3.html#outputxml I ran into trouble, near then end, I am hoping someone else here has got this working and can help me discover my problem. Simply there are 4 steps to this tutorial Creating the Table Populating the Table Outputting XML with PHP Creating the Map I successfully have completed all the steps, however the outputted xml isn't read by the google map I created. The files are all on the same directory, and I didn't change any of the file names from the tutorial. The tutorial has a step to test if the php file called phpsqlajax_genxml.php is outputting the xml and I successfully tested it and it was. The problem is that the map isn't rendering the items I have in the database, that should be converted to xml for the map to read. Any help, or pointing me in the right direction would be much appreciated.

    Read the article

  • PHP OOP Concepts (Value Objects / Data Access Objects)

    - by Iuhiz
    Hi, I've just started to learn PHP OOP, previously I have been doing PHP in a procedural manner. I was reading this article and I've got a couple of quick questions, How is the constructor for value objects commonly defined? As one that takes in all "data members" as parameters or stick to the default constructor and use mutator / accessor methods to set / get data members? Is this actually the recommended way to start doing PHP OOP? Cos honestly, the concepts explained in the article was a tad confusing for me. Cheers

    Read the article

  • URL on apache server does not default to the .php file after / has been added

    - by jeffkee
    Generally a url that looks like this: http://www.domain.com/product.php/12/ will open up product.php and serve the /12/ as request parameters, which then my PHP script can process to pull out the right product info. However when I migrated this whole site, after developing it, to a new server, I get a 404 error, because on that server it's not defaulting to the mother directory/file in case of an absence of requested directories. I vaguely remember learning that this is generally a common apache function but I can't seem to recall how to set it up or how to manipulate it.. if there's an .htaccess method to achieve this that would be great.

    Read the article

  • [jQuery] [PHP] Image manipulation

    - by robertdd
    hello, 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), delete the image! all the images i want to be in a php array, if a image is deleted i want to delete the row from array to, if a image is drag and droped i want to change the position in the array to! ok after the user upload all the images and modify some of it how i can make a DONE button to save the positions of the images? for this small project how u suggest me to 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! thanks!

    Read the article

  • Pear Crypt/HMAC.php failed to open stream

    - by Aaron
    Hello, I am on a MediaTemple Dedicated Virtual server and have enabled Pear using the instructions found at: http://kb.mediatemple.net/questions/514/Enabling+PEAR+by+setting+your+open_basedir+and+include_path Here's the problem... In my PHP script, I have this: require_once 'Crypt/HMAC.php'; When I execute the script, I get this message: S3::require_once(Crypt/HMAC.php) [s3.require-once]: failed to open stream: No such file or directory It's a script for integrating with Amazon S3. When we were on the Grid service it worked fine. I've only had problems since moving to a DV server. I installed the HMAC pear module using this command: pear install Crypt_HMAC Then re-started the server. Still no luck. Any ideas? Thanks a bunch if you can help :)

    Read the article

  • Ideas for a PHP Summer Project

    - by Francesc
    Each student in my school, has to develop a Technology Summer Project. I was thinking in doing something in PHP, using MySQL databases, and something that has some utility for the real life. I'm an advanced PHP developer (not an expert one :). The project has to follow that rules: It's in PHP It's a front-end and a backend Has to be something to solve a real-life problem and useful. I don't have any idea. Can you help me with an idea, please?

    Read the article

  • json_decode returns NULL (php)

    - by schouk
    There is a strange behaviour with json_encode and json_decode and I can't find a solution: My php application calls a php web service. The webservice returns json that looks like this: var_dump($foo): string(62) "?{"action":"set","user":"123123123123","status":"OK"}" now I like to decode the json in my application: $data = json_decode($foo, true) but it returns NULL: var_dump($data): NULL I use php 5. The Content-Type of the response from the webservice: "text/html; charset=utf-8" (also tried to use "application/json; charset=utf-8") What could be the reason?

    Read the article

  • Searching for a Kohana Beginner's Tutorial for PHP

    - by Andreas Grech
    I am going to try to build a PHP website using a framework for the first time, and after some research here and there, I've decided to try to use Kohana I downloaded the source from their website, and ran the downloaded stuff on my web server, and was then greeted with a 'Welcome to Kohana!' page, and nothing more... I've tried to find some beginner tutorials on the web as regard this particular framework, but to my surprise, came up with almost nothing (only this one, but it's not a great deal of help) I am not new to PHP and neither am I new to the MVC concept, but I am very new to PHP Frameworks...so can anyone point me to a Kohana tutorial somewhere on the web that will help me get started in building my website using this framework, from scratch ? P.S. As I said, I want a beginners tutorial as regarding this case. [UPDATE] I am currently reading the Official Guide...we'll see how that goes.

    Read the article

  • Blank Pages with Zen Cart v1.3.8 and PHP 5.3

    - by Michael Soriano
    I am trying to run a live Zen Cart store (version 1.3.8) on a my local machine which is PHP 5.3. I am aware of the incompatibilities between both versions and have dealt with it by applying the patch found here: http://www.zen-cart.com/forum/showthread.php?t=140960 I am able to login the admin side no problem, but when i navigate to the store - all i see are blank pages. How can I fix this issue? I'm hoping there is a fix elsewhere. Trying not to revert to an older PHP installation.

    Read the article

  • PHP Exec command - How to pass input to a series of questions

    - by user556597
    I have a program on my linux server that asks the same series of questions each time it executes and then provides several lines of output. My goal is to automate the input and output with a php script. I know how to capture the output in an array by writing: $out = array(); exec("my/path/program",$out); But how do I handle the input? Assume the program asks 3 questions and valid answers are: left 120 n What is the easiest way using php to pass that input to the program? Can I do it somehow on the exec line? I’m not a php noob but simply have never needed to do this before. Alas, my googling is going in circles.

    Read the article

  • PHP extract GPS EXIF data

    - by Kami
    I would like to extract the GPS EXIF tag from pictures using php. I'm using the exif_read_data() that returns a array of all tags + data : GPS.GPSLatitudeRef: N GPS.GPSLatitude:Array ( [0] => 46/1 [1] => 5403/100 [2] => 0/1 ) GPS.GPSLongitudeRef: E GPS.GPSLongitude:Array ( [0] => 7/1 [1] => 880/100 [2] => 0/1 ) GPS.GPSAltitudeRef: GPS.GPSAltitude: 634/1 I don't know how to interpret 46/1 5403/100 and 0/1 ? 46 might be 46° but what about the rest especially 0/1 ? angle/1 5403/100 0/1 What is this structure about ? How to convert them to "standard" ones (like 46°56'48?N 7°26'39?E from wikipedia) ? I would like to pass thoses coordinates to the google maps api to display the pictures positions on a map !

    Read the article

  • PHP Explode and Get_Url: Not Showing up the URL

    - by elmaso
    hello! its a little bit hard to understand. in the header.php i have this code: <? $ID = $link; $url = downloadLink($ID); ?> I get the ID with this Variable $link -- 12345678 and with $url i get the full link from the functions.php in the functions.php i have this snippet function downloadlink ($d_id) { $res = @get_url ('' . 'http://www.example.com/' . $d_id . '/go.html'); $re = explode ('<iframe', $res); $re = explode ('src="', $re[1]); $re = explode ('"', $re[1]); $url = $re[0]; return $url; } and normally it prints the url out.. but, i cant understand the code..

    Read the article

  • PHP Unlink function Woes on Windows

    - by Abs
    Hello all, I am having problems with the PHP function unlink. I keep getting this error: Warning: unlink(C:\wamp\www\webs\db\db_1276259188.mdb) [function.unlink]: Permission denied in C:\wamp\www\webs\pure-php-export.php on line 242 I am on a windows machine where Apache runs as the user SYSTEM. I have set the permissions of the db folder as "Full Control" for Apache's user. I thought my script might still be holding on to that file (its an uploaded file that gets used via PDO). try{ $dbh = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=$mdbFilename", $username, $password); }catch(PDOException $e){ echo $e->getMessage(); } So before I attempt to delete the file I unset the above and try to delete like so: $dbh = null; unset($dbh); if(is_file($mdbFilename)){ unlink($mdbFilename); } I really appreciate any help on this as it has been driving me mental for the past two hours! Thanks all for any help.

    Read the article

  • PHP - ADO recordsets

    - by Josh
    I am referencing a COM component from PHP. This COM component returns records using ADO. I am assuming I will need to reference ADO in PHP for this to function. How do I do this? Secondly (related to the first question) I have run accross ADODB abstraction libraries, however these seem to mostly deal with queries and handle the ADO internally. How do I get the returned ADO recordset into a PHP friendly array, and likewise pass in an ADO array to the COM object? Thank you, Josh

    Read the article

  • PHP - Rotate a HEX color value (eg swap all colors with "next" hex)

    - by Joe
    I have a set of hex values in an array in PHP. On my page, I have a slider which the user can "slide" to return a value between 1-100. I want to then, based on this slider value, swap all the colors in the array based on the colors "next" color based on the position in the array. An example of the same sort of thing would be like in photshop where you can rotate the hue of a layer. I want to do the same thing, in PHP, for a hex value. Any clues?

    Read the article

  • Some instruction needed for PHP OOPS concepts.

    - by Avinash
    Hi, I need to clear some OOPS concepts in PHP. 1) Which is faster $this-method(); or self:method(); 2) I know the concept of static keyword but can you please post the actual Use of it. Since it can not be accessed by the instance, but is there ant benefit for that? 3) what is factory? How can i use it? 4) What is singleton? How can i use that? 5) What is late static binding? http://www.php.net/manual/en/oop5.intro.php I have gone through below link but I am not getting clear with it. Thanks Avinash

    Read the article

  • $ajaxForm reply back from processing page using jquery and php

    - by Jean
    Hello, I have a page called guestbook.php in which contains $('#guest_form').ajaxForm({}); When the form is triggered it goes to a save.php page which contains and values inserted if($_POST['x']){ $xx = $_POST['x']; $yy = $_POST['y']; $zz = $_POST['z']; $query_one = "INSERT INTO xxx (x1,yl,z1,z2) values ('$xx','$yy','$zz','00000')"; mysql_select_db($database_1, $1); $Result = mysql_query($query_guest_one, $1) or die(mysql_error()); So far so good. Now I run a select query based on the insert and display it in a div on the guestbook.php page. That is where I cannot do it. All help appreciated. Thanks Jean

    Read the article

  • Best practice for storing global data in PHP?

    - by user281434
    Hi I'm running a web application that allows a user to log in. The user can add/remove content to his/her 'library' which is displayed on a page called "library.php". Instead of querying the database for the contents of the users library everytime they load "library.php", I want to store it globally for PHP when the user logs in, so that the query is only run once. Is there a best practice for doing this? fx. storing their library in an array in a session? Thanks for your time

    Read the article

  • PHP Include Windows XP Notepad++ Editor - Nav Include Not Working - Nav Disappears

    - by Lorianna Sprague
    I am creating a website, and have a tabbed horizontal menu. In order to cut back on the number of files I have to edit when I have to make changes to the menu I want to put the navigation in a separate file that I can call using a PHP include statement. When I do this, however, the nav disappears entirely from the page. The rest of the content remains, and there are no error messages. I have been looking for answers for this for weeks, and have tried every version of the PHP include statement that I could find. None of them worked. This was the last attempt. I have the file "nav.php" in a folder named "includes" in a main dir called "testsite" I use Windows XP, use NotePad++ as my text editor, and have been testing in Firefox. I can't find an answer anywhere - any help would be appreciated. Lorianna

    Read the article

  • PHP : How to understand bitmask value of access from ini_get_all function

    - by justjoe
    i'm start to use ini_get_all function to retrieve all configuration option on a shared host server. in the end i got this chunk of array : [allow_call_time_pass_reference] => Array ( [global_value] => 1 [local_value] => 1 [access] => 6 ) [allow_url_fopen] => Array ( [global_value] => 1 [local_value] => 1 [access] => 4 ) The PHP manual just give descripstion : It's possible for a directive to have multiple access levels, which is why access shows the appropriate bitmask values. so, can anybody explain about 'access' ? ans how to understand its bitmask values ?

    Read the article

  • Ruby equivalent of PHP's fopen() method

    - by lagrz
    I'm trying to find out if Ruby has en equivalent of php's fopen() method currently used like this: $fd = fopen("php://stdin", "r"); would that be using ARGV variable? Basically what I plan on doing is forward raw e-mail messages using the .procmailrc file which I already got working in a test php file, but the project requires the use of Ruby. Therefore I'm not 100% sure if using the ARGV variable would work or if somehow I need to capture the e-mail stream by some other means. Any help would be greatly appreciated. Thanks :)

    Read the article

  • PHP File Exists Always False

    - by Joe
    I have a case where file_exists() is always returning false. My latest attempt was to just test to see if it would return true for $_SERVER["SCRIPT_FILENAME"] and then return the value of the path if it couldn't find the file which it does. The path while not necessarily relevant to solving the problem is: /Users/joe/Workspace/720/app/webroot/index.php I have obviously verified that the file is there, and am not even sure how it couldn't be there since php is serving it up. I should mention this is on an install of OS X Snow Leopard running PHP 5.3.0. Any ideas would be fantastic. CODE SAMPLE: if (!file_exists($_SERVER["SCRIPT_FILENAME"])) $errors[] = 'Cant find:'. $_SERVER["SCRIPT_FILENAME"];

    Read the article

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