Search Results

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

Page 226/1708 | < Previous Page | 222 223 224 225 226 227 228 229 230 231 232 233  | Next Page >

  • removing index.php of codeigniter on local

    - by Aldi Aryanto
    i'm trying to remove index.php,in my localhost, but it seems doesn't working,its on http://localhost/testing i put .htacces in 'testing' directory under the htdocs LoadModule rewrite_module modules/mod_rewrite.so at apache/conf also already uncheck here my .htaccess RewriteEngine On RewriteBase /testing/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /testing/index.php/$1 [L] here my config $config['base_url'] = "http://localhost/testing"; $config['index_page'] = ''; $config['uri_protocol'] = 'AUTO'; when i access login controller, it's not found Not Found The requested URL /testing/login was not found on this server. I really don't know what to try next. Any help would be appreciated.

    Read the article

  • PHP exec problem with s3-put

    - by schneck
    Hi there, I use the s3-bash-project to upload data to an S3-Bucket. My command looks like this: /mypath/s3_bash/s3-put -v -k '123456789' -s '/mypath/secret' -T '/mypath/upload/myuploadfile' '/my.bucket/mykeyname' I can run the command from the command line (Mac OS X), and it works well. Now I want to execute it from a PHP-Script: exec($command, $output); but in output, the "s3-put"-command only returns the command's help text. I log the command, and it works if I c&p it from the log the the command line, so there not a problem. It seems that PHP does not pass all the parameters to the command line, although I run escapeshellarg() over all the parameters. I'm using a local XAMPP-Test environment, safe_mode is off. Any ideas?

    Read the article

  • Strange behaviour of mb_detect_order() in PHP

    - by termopro
    I would like to detect encoding of some text (using PHP). For that purpose i use mb_detect_encoding() function. The problem is that the function returns different results if i change the order of possible encodings with mb_detect_order() function. Consider the following example $html = <<< STR ????????????????????????????????????????????????????????????????????????????????????????????????????????? STR; mb_detect_order(array('UTF-8','EUC-JP', 'SJIS', 'eucJP-win', 'SJIS-win', 'JIS', 'ISO-2022-JP','ISO-8859-1','ISO-8859-2')); $originalEncoding = mb_detect_encoding($str); die($originalEncoding); // $originalEncoding = 'UTF-8' However if you change the order of encodings in mb_detect_order() the results will be different: mb_detect_order(array('EUC-JP','UTF-8', 'SJIS', 'eucJP-win', 'SJIS-win', 'JIS', 'ISO-2022-JP','ISO-8859-1','ISO-8859-2')); die($originalEncoding); // $originalEncoding = 'EUC-JP' So my questions are: Why is that happening ? Is there a way in PHP to correctly and unambiguously detect encoding of text ?

    Read the article

  • Create table with PHP and populate from MySQL

    - by typoknig
    Hi all, I am creating a table to display on a web page and that table is populated from data in a MySQL database. I am trying to do a couple of things that are making it difficult for me. First I am trying to have call the PHP code that exists in a separate file in HTML via JavaScript. I think I have that working right but I am not 100% sure (because the table will not display). I think it is working right because some of the code for the table (which is in the PHP file) displays in FireBug. Second I am trying to make it so the rows alternate colors for easy viewing too. My PHP code so far is below. The table does not display at all in any browser. $query = "SELECT * FROM employees"; $result = mysql_query($query); $num = mysql_num_rows($result); echo '<table>'; for ($i = 0; $i < $num; $i++){ $row = mysql_fetch_array($result); $id = $row['id']; $l_name = $row['l_name']; $f_name = $row['f_name']; $ssn = $row['ssn']; $class = (($i % 2) == 0) ? "table_odd_row" : "table_even_row"; echo "<tr>"; echo "<td class=" . $class . ">$wrap_id</td>"; echo "<td class=" . $class . ">$wrap_l_name</td>"; echo "<td class=" . $class . ">$wrap_f_name</td>"; echo "<td class=" . $class . ">$wrap_ssn</td>"; echo "</tr>"; } echo '</table>'; mysql_close($link); }

    Read the article

  • PHP, since upgrading to 5.2.17 getting some warning ?

    - by Jules
    I can't reproduce this on my test server no idea why this is happening, other queries / functions work.. I'm getting this warning PHP Warning: mysql_connect() [<a href='function.mysql-connect'> function.mysql-connect</a>]: Can't connect to MySQL server on '--my isps server--' (10060) in D:\domains\mydomain.com\wwwroot\p hp\_stdfuncs.php on line 191 This function and others like it are having problems (but some are ok), this is my include file... function AddPageError($PageHandle, $Requested) { global $server; global $db; global $user; global $pass; global $sDebug; $con = mysql_connect($server,$user,$pass); I have an include file which sets those variables, as I say they work on other pages and functions.. No idea why ??

    Read the article

  • The largest prime factor with php

    - by Tom
    So, I wrote php program to find the largest prime factor with php and I think it is quite optimal, because it loads quite fast. But there is a problem, it doesn't count very big numbers's prime factors. Here is a program: function is_even($s) { $sk_sum = 0; for($i = 1; $i <= $s; $i++) { if($s % $i == 0) { $sk_sum++; } } if($sk_sum == 2) { return true; } } $x = 600851475143; $i = 2; //x is number while($i <= $x) { if($x % $i == 0) { if(is_even($i)) { $sk = $i; $x = $x / $i; } } $i++; } echo $sk;

    Read the article

  • Include a repetitive chunk of html with PHP?

    - by user146780
    I basically have a div on my Web Site that always has the same stuff. However, this div is not present on all pages which is why I won't use the dynamic web template. I was wondering if it was possible for PHP to get the code from a document on the server and put in into the div? Ex: div id="section... then my text file contains (p) hello (p) basically I want PHP to put it into the div when the user sees it. If theres a smarter way of acheiving this I'd be open to it aswell. Thanks

    Read the article

  • Pass variable number of variables to a class in PHP

    - by user325282
    I need to pass a variable number of strings to instantiate different classes. I can always do a switch on the size of the array: switch(count($a)) { case 1: new Class(${$a[0]}); break; case 2: new Class(${$a[0]}, ${$a[1]}); break; etc... There has to be a better way to do this. If I have an array of strings ("variable1", "variable2", 'variable3", ...), how can I instantiate a Class without manually accounting for every possibility?

    Read the article

  • How to send mail using PHP?

    - by phpaddict
    I'm using Windows Vista OS. PHP, MySQL as the database and Apache web server. I want to send notification to those who want to join in my site. But the problem is when I click submit. It doesn't send anything to the email address of the user. What to do you think is the best solution for this? <?php $to = "[email protected]"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; if (mail($to, $subject, $body)) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?>

    Read the article

  • PHP 1-liner each() with mysql_fetch_assoc()

    - by MVC You Know Me
    Hey All. Trying to create a 1-liner to loop through a mysql result set. Example: $sql = "SELECT uid, role FROM usr WHERE uid = '$this-uid'"; $r = db::q($sql); if($r-rows()) { $q = mysql_fetch_assoc($r-result); while(list($k, $v) = each($q)) { // would like to omit line above and consolidate here $_SESSION['usr'][$k] = $this->$k = $v; } } problem is that consolidating while loop like so: while(list($k, $v) = each(mysql_fetch_assoc($r-result)) returns an error a la each() not getting object or array, even though of course it is. I think the problem is a casting issue, but it does not seem you can do: each( (array) mysql_fetch_assoc($r-result)) Any ideas? I like to code as tersely as possible, and having "$q = mysql_fetch_assoc($r-result)" everywhere will annoy me, does already. Keep posted... Thanks!

    Read the article

  • PHP: "Footer function"?

    - by Ricket
    I have a project. It has a good number of PHP files. Each of these files includes a standard header. They don't include a standard footer. Now I want to do something just before the end of every page. I can go through each page and add the footer code, but I was wondering if there is an easier way (and I think I've seen something like it before, though I might be mistaken). Is there a way to set a "hook" or "trigger" function that will be executed at the end of a page, from the included header PHP script? I'm thinking of something like set_error_handler but to handle a page close event. Or like C's atexit function.

    Read the article

  • value not posting to php script

    - by user3710364
    step1 batch in dynamically loaded after selecting one of the value from dropdown step 2 is loaded by ajax call in setp 2 when i click on edit step 3 is loaded via ajax call again in step 3 when i click on edit ajax call is working fine but its nit posting the value to php script //ajax call function validateFees(strAddNo) { var collectFees = $("#collectFees").val(); if(collectFees == "") { $("#validateFeesResult").html('<div class="info">Please enter your Fees Amount.</div>'); $("#collectFees").focus(); } else { var dataString = 'collectFees' + collectFees + 'strAddNo' + strAddNo; $.ajax({ type: "POST", url: "validateFees_script.php", data: dataString, cache: false, beforeSend: function() { $("#validateFeesResult").html('Loading...'); }, success: function(response) { $("#validateFeesResult").hide().fadeIn('slow').html(response); } }); } } I'm sure it's extremely simple but I'm not understanding how to do it?

    Read the article

  • Restricting IFRAME access in PHP

    - by m0j0
    I am creating a small web page using PHP that will be accessed as an IFRAME from a couple of sites. I'm wanting to restrict access to this site to work ONLY within the "approved" sites, and not other sites or accessed directly. Does anyone have any suggestions? Is this even possible? The PHP site will be Apache, and the sites iframing the content will probably be .NET. Just to clarify, any site can view the page, as long as it's iframe'd within an approved site. I want to block people from accessing it directly. I'm thinking cookies might be a solution, but I'm not sure.

    Read the article

  • PHP and Javascript: Getting file contents with Javascript variable

    - by celliott1997
    Could someone help me to understand why this isn't working? var uname = "<?php echo strtolower($_GET['un']) ?>"; var source = "<?php echo file_get_contents('accounts/"+uname+"') ?>"; console.log(source); I've been trying for a while to get this working and it just doesn't seem to. Before I added in the source variable, it was working fine and displayed the un variable on the page. Thanks.

    Read the article

  • PHP __call vs method_exists

    - by neo
    The Project I'm working on contains something like a wrapper for call_user_func(_array) which does some checks before execution. One of those checks is method_exists (In Case the supplied first argument is an instance of a class and the second is a method name) The other is_callable. The function will throw an exception if one of those checks fails. My Code contains an array with function names (setFoo, setBar, etc.) and the php magic function for overloading (__call) which handles setting, replacing and deletion of certain variables (better certain array elements). The Problem: method_exists will return false if the function is not defined. Do I have any chance to get a true if the __call function does proper handling of the request?

    Read the article

  • PHP: question about passing parameters in URL's

    - by user248959
    Hi, i have this two lines: var_dump($parametros_post_signin); $this->redirect('prueba/aux?email='.$parametros_post_signin['signin']); the first one prints this: array 'signin' => array 'email_address' => string '' (length=0) 'password' => string '' (length=0) the second one takes to another action where i have this code: var_dump($request->getParameter('email')); that prints this: string 'password' (length=8) I expected it to print something like this: string '' (length=0) What should i do to the get value of the 'email_address' field ? Regards Javi

    Read the article

< Previous Page | 222 223 224 225 226 227 228 229 230 231 232 233  | Next Page >