Search Results

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

Page 83/1708 | < Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >

  • Htaccess rewrite rule .aspx to .php

    - by Markus Ossi
    Background: I have a website that has been built with ASP.NET 2.0 and is on Windows hosting. I now have to rewrite my site in PHP and move it into Linux hosting. I have a lot of incoming links to my site from around the web that point directly into the old .aspx-pages. The site itself is very simple, one dynamic page and five static ones. I saved the static .aspx pages as .php-pages and rewrote the dynamic page in PHP. The dynamic page is called City.aspx and I have written it in PHP and it is now called City.php. On my old Windows hosting, I used ASP.NET's URL mapping for friendly URL. For example, incoming URL request for Laajakaista/Ypaja.aspx was mapped into City.aspx?CityID=981. My goal: To redirect all human visitors and search engines looking for the old .aspx pages into the new .php pages. I am thinking that the easiest way to redirect visitors into new pages will be by making a redirect, where all requests for .aspx-files will be redirected into .php filetypes. So, if someone asks for MYSITE/City.aspx?CityID=5, they will be taken into MYSITE/City.php?CityID=5 instead. However, I am having a lot of trouble getting this to work. So far this is what I have found: rewriterule ^([.]+)\.aspx$ http://www.example.com/$1.php [R=301,L] However, I think this can not handle the parameters after the filetype and I am also not quite sure what to put on front. To make things a bit more complicated, at my previous site I used friendly URL's so that I had a huge mapping file with mappings like this: <add url="~/Laajakaista/Ypaja.aspx" mappedUrl="~/City.aspx?CityID=981" /> <add url="~/Laajakaista/Aetsa.aspx" mappedUrl="~/City.aspx?CityID=988" /> <add url="~/Laajakaista/Ahtari.aspx" mappedUrl="~/City.aspx?CityID=989" /> <add url="~/Laajakaista/Aanekoski.aspx" mappedUrl="~/City.aspx?CityID=992" /> I tried to make a simple redirect like this: Redirect 301 Laajakaista/Aanekoski.aspx City.php?CityID=992 but was not able to get it to work. I ended up with an internal server error and a 50k .htaccess-file... Any help is greatly appreciated.

    Read the article

  • PHP 6.0 - Roadmap?

    - by JustinT
    With the recent announcement that PHP 6 development has been halted, I'm confused as to what the PHP 5.x and 6.x road map includes. The current version of PHP is 5.3.2. There were quite a few significant features to come in PHP 6.0, such as: APC include for automatic bytecode caching Unicode support etc.. Question: What is the new road map of PHP given 6.0 has been canceled? What major features will be available next and in what release?

    Read the article

  • PHP and jquery restrict direct access

    - by Sergio
    Is it possible to restrict direct access to PHP file if I use jquery .load function like this one: $(document).ready(function(){ $("#second").load("testip.php"); }); In this case I want to restrict direct access to file testip.php that will instert data in database. Can I do it using some PHP function that will compare visitors IP address and server IP at "testip.php" file or there is some better way to do it?

    Read the article

  • Populating fields in modal form using PHP, jQuery

    - by Benjamin
    I have a form that adds links to a database, deletes them, and -- soon -- allows the user to edit details. I am using jQuery and Ajax heavily on this project and would like to keep all control in the same page. In the past, to handle editing something like details about another website (link entry), I would have sent the user to another PHP page with form fields populated with PHP from a MySQL database table. How do I accomplish this using a jQuery UI modal form and calling the details individually for that particular entry? Here is what I have so far- <?php while ($linkDetails = mysql_fetch_assoc($getLinks)) {?> <div class="linkBox ui-corner-all" id="linkID<?php echo $linkDetails['id'];?>"> <div class="linkHeader"><?php echo $linkDetails['title'];?></div> <div class="linkDescription"><p><?php echo $linkDetails['description'];?></p> <p><strong>Link:</strong><br/> <span class="link"><a href="<?php echo $linkDetails['url'];?>" target="_blank"><?php echo $linkDetails['url'];?></a></span></p></div> <p align="right"> <span class="control"> <span class="delete addButton ui-state-default">Delete</span> <span class="edit addButton ui-state-default">Edit</span> </span> </p> </div> <?php }?> And here is the jQuery that I am using to delete entries- $(".delete").click(function() { var parent = $(this).closest('div'); var id = parent.attr('id'); $("#delete-confirm").dialog({ resizable: false, modal: true, title: 'Delete Link?', buttons: { 'Delete': function() { var dataString = 'id='+ id ; $.ajax({ type: "POST", url: "../includes/forms/delete_link.php", data: dataString, cache: false, success: function() { parent.fadeOut('slow'); $("#delete-confirm").dialog('close'); } }); }, Cancel: function() { $(this).dialog('close'); } } }); return false; }); Everything is working just fine, just need to find a solution to edit. Thanks!

    Read the article

  • PHP Zend Debugger configuration

    - by newbie123
    Hi i am new to php, I currently learning php using eclipse. I know i have to install the zend debugger my php.ini store at c:windows i had added in these line: [Zend] zend_extension=c:/php/ext/ZendDebugger.dll zend_debugger.allow_hosts=127.0.0.1 zend_debugger.expose_remotely=always zend_debugger.connector_port=10013 but on command prompt i tried php -m it shown that i never install zend debugger. I not sure where goes wrong I check phpinfo also never show any zend information.

    Read the article

  • PHP Extended CHM Manual Gone?

    - by Alix Axel
    I'm sorry for maybe posting a question that may not be directly related to programming but where can I find an up to date version of the Extended PHP Manual (the one with the user comments) for download? The usual URL (http://www.php.net/docs-echm.php) seems to redirect to the (http://www.php.net/download-docs.php), was it discontinued?

    Read the article

  • What is the holdup on PHP 6?

    - by Billy ONeal
    I've read in multiple places, including highly recommended PHP books published several years ago, that PHP 6 was just over the horizon, and would fix several of the BIG outstanding issues with PHP (namely unicode support). However, its been several years even since I've read those books, and PHP 6 is still not considered kosher for production use. Is there a specific feature that is proving difficult to implement or is it a simple lack of community desire to develop PHP 6?

    Read the article

  • PHP sessions and class members.

    - by JDW
    Ok, messing about with classes in PHP and can't get it to work the way I'm used to as a C++/Java-guy. In the "_init" funtion, if I run a query at the "// query works here" line", everythong works, but in the "getUserID" function, all that happens is said warning... "getUserID" gets called from login.php (they are in the same dir): login.php <?php include_once 'sitehandler.php'; include_once 'dbhandler.php'; session_start(); #TODO: Safer input handling $t_userName = $_POST["name"]; $t_userId = $_SESSION['handler']['db']->getUserID($t_userName); if ($t_userId != -1) { $_SESSION['user']['name'] = $t_userName; $_SESSION['user']['id'] = $t_userId; } //error_log("user: " . $_SESSION['user']['name'] . ", id: ". $_SESSION['user']['id']); header("Location: " . $_SERVER["HTTP_REFERER"]); ? dbhandler.php <?php include_once 'handler.php'; class DBHandler extends HandlerAbstract { private $m_handle; function __construct() { parent::__construct(); } public function test() { #TODO: isdir liquibase #TODO: isfile liquibase-195/liquibase + .bat + execrights $this->m_isTested = true; } public function _init() { if (!$this->isTested()) $this->test(); if (!file_exists('files/data.db')) { #TODO: How to to if host is Windows based? exec('./files/liquibase-1.9.5/liquibase --driver=org.sqlite.JDBC --changeLogFile=files/data_db.xml --url=jdbc:sqlite:files/data.db update'); #TODO: quit if not success } #TODO: Set with default data try { $this->m_handle = new SQLite3('files/data.db'); } catch (Exception $e) { die("<hr />" . $e->getMessage() . "<hr />"); } // query works here $this->m_isSetup = true; } public function teardown() { } public function getUserID($name) { // PHP Warning: SQLite3::prepare(): The SQLite3 object has not been correctly initialised in $t_statement = $this->m_handle->prepare("SELECT id FROM users WHERE name = :name"); $t_statement->bindValue(":name", $name, SQLITE3_TEXT); $t_result = $t_statement->execute(); //var_dump($this->m_handle); return ($t_result)? (int)$t_result['id']: -1; } }

    Read the article

  • Getting relative path from absolute path in PHP

    - by SpawnCxy
    I noticed that there're some similar questions about this problem when I typed the title,but they seem not be in PHP.So what's the solution to it with a PHP function? To be specified. $a="/home/apache/a/a.php"; $b="/home/root/b/b.php"; $relpath = getRelativePath($a,$b);//needed function,should return '../../root/b/b.php' Any good ideas?Thanks.

    Read the article

  • php problem with function

    - by moustafa
    i have this function drawBoard(){ global $cBoard; $R = "<img src=rp.gif>"; //Red piece $B = "<img src=bp.gif>"; //black piece $ES = "<img src=blank.gif>"; // legal square image $IS = "<img src=blank1.gif>"; //illegal square image $cBoard = array( array($IS, $R, $IS, $R, $IS, $R, $IS, $R), array($R, $IS, $R, $IS, $R, $IS, $R, $IS), array($IS, $R, $IS, $R, $IS, $R, $IS, $R), array($ES, $IS, $ES, $IS, $ES, $IS, $ES, $IS), array($IS, $ES, $IS, $ES, $IS, $ES, $IS, $ES), array($B, $IS, $B, $IS, $B, $IS, $B, $IS), array($IS, $B, $IS, $B, $IS, $B, $IS, $B), array($B, $IS, $B, $IS, $B, $IS, $B, $IS) ); echo "<table border='3' width='200'>n"; foreach ($cBoard as $row){ switch($row){ case "8": $row = 0; break; case "7": $row = 1; break; case "6": $row = 2; break; case "5": $row = 3; break; case "4": $row = 4; break; case "3": $row = 5; break; case "2": $row = 6; break; case "1": $row = 7; break; } echo "<tr>n"; foreach ($row as $piece){ echo "<td>"; echo "$piece "; echo "</td>n"; switch($Piece){ case "A": $piece = 0; break; case "B": $piece = 1; break; case "C": $piece = 2; break; case "D": $piece = 3; break; case "E": $piece = 4; break; case "F": $piece = 5; break; case "G": $piece = 6; break; case "H": $piece = 7; break; } } } echo "</tr>n"; echo "</table>n"; } now im trying to parse a file into the array with color codes how i can do that

    Read the article

  • help with php/cake error

    - by adam
    I tried to clone beta.neighborrow.com - i copied the directory file for file but im getting this error on the new url instillbliss.neighborrow.com Warning: require(cake/basics.php) [function.require]: failed to open stream: No such file or directory in /home/neighborrow/instillbliss.neighborrow.com/index.php on line 53 Fatal error: require() [function.require]: Failed opening required 'cake/basics.php' (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear:/home/neighborrow/instillbliss.neighborrow.com:/home/neighborrow/instillbliss.neighborrow.com/app/') in /home/neighborrow/instillbliss.neighborrow.com/index.php on line 53

    Read the article

  • php redirect and querystring

    - by kusanagi
    i have script <?php $to = $_GET["to"]; header("Location: $to"); ?> if i call script such out.php?to=http://site.ru/page.php?param1=1&param2=2 in param $to be only http://site.ru/page.php?param1=1& how to fix? i want that $to = http://site.ru/page.php?param1=1&param2=2

    Read the article

  • Powerbuilder Dynamic Array Manipulation

    - by TomatoSandwich
    string array[] long lBound, uBound lBound = LowerBound(array[]) // = 1, empty array value uBound = UpperBound(array[]) // = 0, empty array value array[1] = 'Item 1' array[2] = 'Item 2' array[3] = 'Item 3' lBound = LowerBound(array[]) // = 1 uBound = UpperBound(array[]) // = 3 array[3] = '' //removing item 3 lBound = LowerBound(array[]) // = 1, still uBound = UpperBound(array[]) // = 3, still (but array[3] is nulled? I think the line 'array[3]' is wrong, but I think I've read that this should remove the array cell. What would be the right way to remove an array cell? Does it depend on object type? (String vs Number vs Object) Or Can one manipulate the UpperBound value to make it work? i.e. after removing Item 3, I want the UpperBound, or arraylength, to be 2, since this is logically correct.

    Read the article

  • Proper indentation in array initialization, PDT/Zend Studio

    - by Sergei Stolyarov
    I'm using the following style of array initialization in the code: $a = array( 'one' => 123, 'two' => 456 ); But PDT/Zend Studio doesn't work properly in this case; after pressing [Return] key it places cursor under the $a (in my example) and ignores indentation. If array keys are numbers (at least not start with quotation marks) everything is working fine. This is how it works currently (| — is a position where edtitor places caret after pressing [Return]) $a = array( 'one' => 123,[RETURN] | ); This is expected result: $a = array( 'one' => 123,[RETURN] | ); So is it possible to force editor follow my indentation rules?

    Read the article

  • How to assign the array key a value, when the key name is itself a variable

    - by Matrym
    How do I identify an item in a hash array if the key of the array is only known within a variable? For example: var key = "myKey"; var array = {myKey: 1, anotherKey: 2}; alert(array.key); Also, how would I assign a value to that key, having identified it with the variable? This is, of course, assuming that I must use the variable key to identify which item in the array to alert. Thanks in advance!

    Read the article

  • convert object to array

    - by zahir hussain
    <?php print_r($response->response->docs); ?> display the following Array ( [0] => Object ( [_fields:private] => Array ( [id]=>9093 [name]=>zahir) Object ( [_fields:private] => Array ( [id]=>9094 [name]=>hussain)..) how to change the object to array... i want the following Array([0]=>([id]=>9093 [name]=>zahir) [1]=>([id]=>9094 [name]=>hussain)...) can i do? no one can answer....

    Read the article

  • Accessing 2D array and passing string to label.text

    - by Amir
    Hi. I'm trying to create 2D array and initialize it with NSStrings. When I try to copy content of a cell from the array to a label.text, the application crashes. NSMutableArray *array = [NSMutableArray arrayWithCapacity:0]; [array addObject:[NSMutableArray arrayWithObjects: [NSArray arrayWithObjects: @"0-0", @"0-1", @"0-2", nil], [NSArray arrayWithObjects: @"1-0", @"1-1", @"1-2", nil], [NSArray arrayWithObjects: @"2-0", @"2-1", @"2-2", nil], nil]]; label.text = [[array objectAtIndex:0] objectAtIndex:0]; Any idea why and what am I doing wrong?

    Read the article

  • Data from array to sql

    - by espentf
    I'm making a webshop for a school asignment and therfore i needed to make a shopping cart. In the shopping cart the data is storred in an array. The code for when I echo it out is <tr> <td><?php echo $row['Navn'];?></td> <td><input type="text" name="antall-<?php echo $row['id_produkt'];?>" size="5" value=" <?php echo $_SESSION['handlekurv'][$row['id_produkt']]['antall'];?>" /> </td> <td><?php echo $row['Pris'];?></td> <td><?php echo $_SESSION['handlekurv'][$row['id_produkt']]['antall']*$row['Pris'];?></td></tr> What i want is the store the data this code echoes out from the array, in a sql database. Is there anyone who can help me whith this problem?

    Read the article

  • getting a date array from a mysql database?

    - by user296516
    Hi guys, I have a database with date field is this format "2010.06.11. | 10:26 13" What is need is a php array that would hold all the different dates, .i.e. array[0] = "2010.06.09." array[1] = "2010.06.10." array[2] = "2010.06.11." Currently I am doing it by selecting the whole table, then looping through the result and adding the date substr to an array if it is not already there. But maybe there is a faster way? Thanks.

    Read the article

  • Displaying Array in Select - FORM API Drupal

    - by Krishma
    Hi: I want to add key(type_id) and value(type_description) to select in drupal form API $result_x-product_types-RPMProductType is array result from Database :- array(4) { [0]= object(stdClass)#18 (2) { ["type_description"]= string(10) "Calendered" ["type_id"]= int(1) } [1]= object(stdClass)#19 (2) { ["type_description"]= string(8) "Extruded" ["type_id"]= int(2) } [2]= object(stdClass)#20 (2) { ["type_description"]= string(6) "Molded" ["type_id"]= int(3) } [3]= object(stdClass)#21 (2) { ["type_description"]= string(5) "Other" ["type_id"]= int(4) } } foreach ($result_x-product_types-RPMProductType as $data) { $form['manufacturer_add_new_sales']['product_type'] = array( '#type' = 'select', '#title' = t('Product Type'), '#options'=array($data-type_id=$data-type_description), ); } When do so I am getting only last value i.e Other. How to correctly loop to bind Select to display all the array Key - Values. Thank you in advance.

    Read the article

  • crazy things with PHP array...

    - by user296516
    Hi, A very strange thing, I have an array where element 7 is '[1000137d]', but when I try to compare it by using if ( $array[7] == '[1000137d]' ) it will return a negative. echo $array[7]; echo '<br>'; echo '[1000137d]'; echo '<br>'; echo md5($array[7]); echo '<br>'; echo md5('[1000137d]'); this code would echo out: [1000137d] [1000137d] ca9983334e720042e3a6cbb1dd6b7fd2 3b1c21e661bd7d38deda1f4a45eaa23b as you can see $array[7] is identical to [1000137d], yet their md5's differ. what do you think might be the problem? Thanks!

    Read the article

  • Get from associative array only that elements which keys are specified

    - by hsz
    Hello ! It's late and I know it is a very simple question but right now I do not have an idea and deadline is near.. I've got two arrays: $array1 = array( 'a' => 'asdasd', 'b' => 'gtrgrtg', 'c' => 'fwefwefw', 'd' => 'trhrtgr', ); $array2 = array( 'b', 'c' ); What was the name of function to get a part of assoc array by keys from the second array ? $result = array( 'b' => 'gtrgrtg', 'c' => 'fwefwefw', ); Thanks !

    Read the article

  • Unix tree convert to recursive php array

    - by Fordnox
    I have a response from remote server like this: /home/computer/Downloads |-- /home/computer/Downloads/Apple | `-- /home/computer/Downloads/Apple/Pad |-- /home/computer/Downloads/Empty_Folder `-- /home/computer/Downloads/Subfolder |-- /home/computer/Downloads/Subfolder/Empty `-- /home/computer/Downloads/Subfolder/SubSubFolder `-- /home/computer/Downloads/Subfolder/SubSubFolder/Test this is the output for command computer@athome:$ tree -df --noreport -L 5 /home/computer/Downloads/ I would like to parse this string to recursive php array or object, something like this. I would show only part of result to get the idea. array( 'title' => '/home/computer/Downloads', 'children' => array( 0 => array( 'title' => '/home/computer/Downloads/Apple', 'children' => array( ... ) ) ); Response from server can change according to scanned directory. Can someone help me write this function. Please note that this is response from remote server and php functions can not scan any remote dir.

    Read the article

< Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >