Search Results

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

Page 144/1708 | < Previous Page | 140 141 142 143 144 145 146 147 148 149 150 151  | Next Page >

  • HttpWebRequest POST and retrieve data from php script after login

    - by KenaGT
    Hello guys i am newbie to this stuff so i'll try to explain my problem.I am building application that retrieve data after login to php script that looks like this: https://zamger.etf.unsa.ba/getrssid.php (see the page source for php scirpt definition) and definition(source) here: Korisnicko ime (UID): Šifra: After i login it shows me data that i must collect like this: RSSID: 1321B312 (this is only data that it shows and nothing else) I must do this with httpwebrequest but don't know how i tried to do it with POST(data) but it always give me the defnition of php script as response.But i need response to be like "RSSID: 1321B312" not as script definition mentioned above...please heeelp ASAP....

    Read the article

  • php include not working on IE?

    - by janoChen
    This include is not working in IE: <?php include_once 'localization.php'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Global Colleague</title> <link href="css/style.css" rel="stylesheet" type="text/css"/><!--Start Kampyle Exit-Popup Code--> <script type="text/javascript"> Calling an array inside localization.php <?php echo l('content_p3'); ?>

    Read the article

  • is php language C?

    - by avon_verma
    Ok: I edited my question: I heared somewhere, that php language is written by C. So i have question: what happens for example when you run a function in php such as date("Ymd"); or file_get_contents("file.txt");? Does it translate that code to C and request to server, or does php do it? sorry i haven't a clue And if it does translate it and request, that means besically it is C? sorry for english Thank you, Anon Verma

    Read the article

  • Disable globbing in PHP exec()

    - by wxs
    I have a PHP script which calls another script in order to add IP addresses to a whitelist. I sometimes want to whitelist all addresses, in which case I have it call exec("otherscript *.*.*.*", output, retval); This worked fine, adding the string "*.*.*.*" to the whitelist until I happened to have another file in the directory of the php script that matched that pattern ("foo.1.tar.gz"), at which point the wildcards were expanded, and I ended up with the filename in my whitelist. Is there some way to disable globbing in php's exec? It isn't mentioned in the PHP docs as far as I can tell.

    Read the article

  • Will array_unique work also with array of objects?

    - by Richard Knop
    Is there a better way than using array-walk in combination with unserialize? I have two arrays which contain objects. The objects can be same or can be different. I want to merge both arrays and keep only unique objects. This seems to me like a very long solution for something so trivial. Is there any other way? class Dummy { private $name; public function __construct($theName) {$this->name=$theName;} } $arr = array(); $arr[] = new Dummy('Dummy 1'); $arr[] = new Dummy('Dummy 2'); $arr[] = new Dummy('Dummy 3'); $arr2 = array(); $arr2[] = new Dummy('Dummy 1'); $arr2[] = new Dummy('Dummy 2'); $arr2[] = new Dummy('Dummy 3'); function serializeArrayWalk(&$item) { $item = serialize($item); } function unSerializeArrayWalk(&$item) { $item = unserialize($item); } $finalArr = array_merge($arr, $arr2); array_walk($finalArr, 'serializeArrayWalk'); $finalArr = array_unique($finalArr); array_walk($finalArr, 'unSerializeArrayWalk'); var_dump($finalArr);

    Read the article

  • Is it possible to send back a json array along with seperate variables

    - by Scarface
    Hey guys I have an ajax jquery function that receives data from a php script. I want to return an array with all the online users which is retrieved from a mysql statement, and I want to send other separate variables I need for other purposes along with it. If anyone has any ideas, I would greatly appreciate it. NOTE: the example below is to illustrate what I want to do, I understand that json-encoding the array with other variables is dysfunctional. JQUERY $.ajax({ type: "POST", data: "parameters", url: "retrieval.php", dataType: 'json', success: function(json) { $('#div1').html(json.array); $('#div2').html(json.variable1); $('#div3').html(json.variable2); } }) PHP $qryuserscount1="SELECT * FROM active_users"; $userscount1=mysql_query($qryuserscount1); while ($row = mysql_fetch_array($userscount1)) { $onlineuser= $row['username']; $id=$row['id']; $data[]=$onlineuser.$id; //for example there are 3 users, should send 3 entries back } $data['variable1']='something'; $data['variable2']='something else'; $out = json_encode($data); print $out;

    Read the article

  • Ruby on Rails or PHP... Somehow uncertain

    - by Clamm
    Hi everybody... I've been thinking about this a long time now but i wanna hear your opinion because i always received the ebst answers here. So in advance... thank you guys. Right now i have to make this decision: Shift a prototype webservice to production quality. Choose either Ruby or PHP... (Background: A friend of mine is joining the project and prefers rails) I've already played around a bit with RoR (only basic stuff) but i am really disappointed about the documentation of Rails and Ruby. In relation to PHP i find only fragments or hard to use references. At the end i am a bit scared. I dont wanna waste my time realizing that i am not capable of doing s.th in Ruby what i could with PHP. Maybe only because i am too stupid and don't find a proper explanation ;-) Did anyone experience this shift and can tell me how easy/hard it was to switch from PHP to Ruby? E.G. would you recommend programming it in PHP and using MVC as a base pattern? Thanks for your opinion!!!

    Read the article

  • generate PHP classes from XSD?

    - by Qwerty
    Is there in the world analogues of JavaBeans or JAXB for PHP? Is it possible to generate PHP classes from XML schema? It's common practice to publish API's as XSD schemas. Java and C# guys can get advantage of this by generating classes right from XSD. Is there same tool for PHP?

    Read the article

  • How to create several records in only one dynamic form?

    - by Fernando
    Hi experts, please help me with a simple PHP doubt. I have a simple form: < form action="foo" Person: < a href="javascript:addmore();"Add More < /form Every time the user clicks Add More two new input fields will be dynamically created using jQuery. This can be done several times in a same form. < form action="foo" Person: < a href="javascript:addmore();"Add More < /form Each pair (name and last_name) should create on record in my db. Two Questions: 1) What is the best option for input id? Appending a counter is the best option? 2) How can I handle it in the backend using php? Let me know if you need more info. Thanks in advance.

    Read the article

  • html-embedded php code not executing when hosted on iis

    - by Jack
    <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> <TITLE></TITLE> </HEAD> <BODY> <?php echo '<p>Hello World</p>'; ?> </BODY> </HTML> When I run the above code in a browser, firefox renders it like this: Hello World '; ?> I am doing my coding in Windows XP/IIS 5.1. I have PHP set up correctly because I have no problem running .php files. The problem, it seems to me, is that IIS can't render php code embedded inside html. Does anyone know how to fix this problem or should i switch to Apache?

    Read the article

  • php class crash course

    - by rabidmachine9
    Hello people, I'm sorry for this question but I'm getting crazy trying to write my first php clash, it is supposed to connect me to server and to a database but I'm always getting this error: Parse error: syntax error, unexpected ',', expecting T_PAAMAYIM_NEKUDOTAYIM in /Applications/XAMPP/xamppfiles/htdocs/classTest/test.php on line 9 thanks in advance, here is the code: <?php // include 'DBConnect.php'; class DBConnect { function connection($hostname = "localhost", $myname = "root", $pass = ''){ mysql_connect(&hostname, &myname, &pass) or die("Could not connect!"); //Connect to mysql } function choose($dbnam){ mysql_select_db(&dbnam) or die("Couldn't find database!"); //fnd specific db } } $a = new DBConnect(); $connect = $a->connection("localhost", "root"); $a->choose('mydb'); ?>

    Read the article

  • PHP debugging or performance Hook

    - by Joshua
    In an interpreted language like PHP it is possible in theory to set up some sort of callback function that would be run indiscriminately after every line of code. I am wondering if such a thing exists in PHP or if such a thing could be accomplished in any way? Such a feature could be useful for diagnostics or performance tests. Does anyone know of such a mechanism in PHP?

    Read the article

  • Echo html+php from database

    - by pg-robban
    I am working on a site which deals with a lot of texts in HTML, so recently I learned PHP and moved them into a MySQL database and echo the contents given a specific chapter and section. Now this works relatively fine, the HTML shows up properly. However, in some parts I have included PHP function calls, and these doesn't seem to be evaluated - rather, they get just inserted into the source code (and thus invisible for the page viewer), never doing anything. They did work when they were simple .html files. How can I solve this? For example, a text can look like this: <?php printChapterName(); ?> <p>Some text</p> ... <?php showImage($name, $alt-text); ?> ... This just shows the text on the page. Edit: The functions are echo:ing some HTML.

    Read the article

  • iPhone: Try to send html code to a php script (but fail)

    - by Marc-André Weibezahn
    Hello all, I am trying this for an iPhone app in Xcode: create html code for a website on the fly sending it to a php-script and getting the response with this code: NSError * error = [[[NSError alloc]init]autorelease]; NSURL * phpURL = [NSURL URLWithString: @"http://www.mydomain.com/myscript.php?mywebsite= (...websitestring...) ];NSString * myResponse = [NSString stringWithContentsOfURL:phpURL encoding:NSUTF8StringEncoding error:&error]; It does not work. It should not be a problem of the php code because when I replace the websitestring which contains the html code with "hello" or something, this is accepted. (the script then creates a file "test.html" with the content I sent.) But when I put html code in it, I always get the error: Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa error 256.)" UserInfo=0x322ec10 {} It seems that there are some things to consider when sending code to php? Thanks in advance!

    Read the article

  • Access control of page in php

    - by garcon1986
    Hello, I want to control the access in php website. I have a solution right now with switch case. <?php $obj = $_GET['obj']; switch ($obj) { case a: include ('a.php'); break; default: include ('f.php'); } ?> But when i have so many pages, it becomes difficult to manage them. Do you have better solutions? Right now, i develop the application using php4. And i want to use php5. Do you have any suggestions when i develop it using php5? Thanks

    Read the article

  • 3 small PHP errors I cannot decipher

    - by Dave
    *Notice: Use of undefined constant _ - assumed '_' in /.../uploader.php on line 45* Line 45 $newname = str_replace(array(' ', '&'), array('_', 'and'), trim( strip_tags( $_POST['name'] ) ) ) . _ . $formKey->generateKey() . '_' . time() . '.jpg'; Notice: Undefined index: approve in /.../uploader.php on line 81 Line 81 - the second last line here $query = sprintf("INSERT INTO `$db_name`.`the_table` (`id` , `name` , `photo` , `email` , `date` , `code` , `subscribe` , `approve` , `created` ) VALUES ( NULL , '%s', '%s', '%s', '%s', '%s', '%s', '1', CURRENT_TIMESTAMP );", mysql_real_escape_string($_POST['name']), mysql_real_escape_string($newname), mysql_real_escape_string($_POST['email']), mysql_real_escape_string($date), mysql_real_escape_string($_POST['code']), mysql_real_escape_string($subscribe), mysql_real_escape_string($_POST['approve']) ); Warning: Cannot modify header information - headers already sent by (output started at /.../uploader.php:45) in/.../uploader.php on line 102 Line 45 $newname = str_replace(array(' ', '&'), array('_', 'and'), trim( strip_tags( $_POST['name'] ) ) ) . _ . $formKey->generateKey() . '_' . time() . '.jpg'; Line 102 - the third line here if ($success == 'Done') { $page = 'uploader'; header('Location: ./thanks.php'); } else { echo "error"; }

    Read the article

< Previous Page | 140 141 142 143 144 145 146 147 148 149 150 151  | Next Page >