Search Results

Search found 3120 results on 125 pages for 'php5 oop'.

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

  • How to convert a PHP object to a string?

    - by Rohan
    I get this error: Catchable fatal error: Object of class stdClass could not be converted to string So, my question is, how do I convert an object to a string in PHP? I don't want to serialize it though. Just a note: the code I use works in PHP 4, but not in PHP 5 Thanks!

    Read the article

  • Object Oriented PHP books

    - by user275074
    Hi, I've realised just how rusty my knowledge of PHP 5 and advanced PHP programming is after completing some questions for a test. I seriously need to read a book or something. Any recommendations for PHP 5 books?

    Read the article

  • exclude the folders - url rewrite in htaccess

    - by aquagirl
    rewriteCond %{REQUEST_URI} ^(ajax|css|functions|image_viewer|images|img|include|fancybox|jquery|jscript|json)$ - [L] RewriteRule ^(.[^/])/(.[^/])/(.+[^/]) ?program=$1&usertype=$2&username=$3 [NC] could you please help me find what is wrong in this.. ? I need to exclude some folders from url rewriting. i tried with the solution given here.. but still i am getting some errors.. http://www.idxsync.com/sbaor/Search/Agent/zz please help me

    Read the article

  • Php compatibility question

    - by Undgerman
    I am trying to run cimyadmin(http://cimyadmin.net/) but i am getting a lot of helper depreciation errors and after looking around the web for answers i am convinced its a php issue.Is there a way to run php 5.0.2 or earlier but not less than php 5 code on latest distributions of php.

    Read the article

  • PHP Plugin based App design

    - by Aviatrix
    Hello , I was wondering from where i can get more info on how to build plugin based Apps (design patterns , etc ). Any books and references with detailed information would be helpful. Also i like how WordpPress was made , if someone can point me on how to build something like WordpPress did would be awesome. Thanks !

    Read the article

  • Why won't my PHP script work?

    - by sadicool
    I have a script that reports the following error: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'admin'@'localhost' (using password: YES) in C:\wamp\www\bits\includes\connect.inc.php on line 10 Notice: Undefined variable: l_error in C:\wamp\www\bits\includes\connect.inc.php on line 12 Notice: Undefined variable: l_cannotconnecttodatabase in C:\wamp\www\bits\includes\connect.inc.php on line 12 Why would this be?

    Read the article

  • Seasonal Pricing for a Hotel Room

    - by Laykes
    I am trying to manage seasonal prices for hotel rooms. The only way that I can think of doing it would be to use: | DayDate |EndDate | A | B ----------------------------------------------- | 2010/07/1 |2010/07/2 | 200 | 40 | 2010/07/3 |2010/07/4 | 150 | 40 | 2010/07/5 |2010/07/5 | 150 | 50 | 2010/07/6 |2010/07/7 | 200 | 50 | 2010/07/8 |2010/07/9 | 100 | 60 etc.. (table taken from another question). The problem is: I don't want my seasons to be year specific. Seasons for rooms shouldn't change year on year. I don't want my users to have to enter the seasonal information several times. I am also going to have thousands of rooms, so I don't know a way to make this easily manageable. I'm using mysql and php.

    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

  • entering datas of php page to database

    - by Rahima farzana.S
    I have a php form with two text boxes and i want to enter the text box values into the database. I have created the table (with two columns namely webmeasurementsuite id and webmeasurements id) I used the following syntax for creating table: CREATE TABLE `radio` ( `webmeasurementsuite id` INT NOT NULL, `webmeasurements id` INT NOT NULL ); Utilising the tutorial in the following link, I wrote the php coding but unfortunately the datas are not getting entered into the database. I am getting an error in the insert sql syntax. I checked it but i am not able to trace out the error.Can anyone correct me? I got the coding from http://www.webune.com/forums/php-how-to-enter-data-into-database-with-php-scripts.html $sql = "INSERT INTO $db_table(webmeasurementsuite id,webmeasurements id) values ('".mysql_real_escape_string(stripslashes($_REQUEST['webmeasurementsuite id']))."','".mysql_real_escape_string(stripslashes($_REQUEST['webmeasurements id']))."')"; echo$sql; My error is as follows: INSERT INTO radio(webmeasurementsuite id,webmeasurements id) values ('','')ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'id,webmeasurements id) values ('','')' at line 1

    Read the article

  • What is the efficient way to make a permission system?

    - by WEBProject
    Currently im just using something like: in the DB Table: access: home,register,login and then in each page: if(!Functions::has_rights('content')) { Functions::noAccess(); } is there more efficient way to do it, php & MySQL? i may want to gain access even to several parts a page, for example: user can read a page, but doesnt comment to it, and I dont want to build a separate system to each module. Thanks in advanced, Tal.

    Read the article

  • Header redirect and Session start() generating errors

    - by RPK
    I am using following code. I get errors: Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/mc/cpanel/Source/verifylogin.php:11) Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/public_html/mv/cpanel/Source/verifylogin.php:11) Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/public_html/mv/cpanel/Source/verifylogin.php:11) <?php error_reporting(E_ALL^ E_NOTICE); ob_start(); require("../Lib/dbaccess.php"); $inQuery = "SELECT mhuserid, mhusername FROM cpanelusers WHERE mhusername = '". $_POST['UserName'] ."' AND mhpassword = '". hash('sha512', $_POST['Password']) ."'"; try { $Result = dbaccess::GetRows($inQuery); echo $Result; $NumRows = mysql_num_rows($Result); if ($NumRows > 0) { header("Location: http://www.example.com/cpanel/mainwindow.php"); session_start(); } else { header("Location: http://www.example.com/cpanel/"); echo "Last login attempt failed."; exit; } } catch(exception $e) { } ob_clean(); ?>

    Read the article

  • display items vertically

    - by shawn swanson
    This is my code: <?php while($fetch_cat = mysql_fetch_array($rescat)) { $per_cnt++; ?> <li style="margin-left:10px;"> <a href="sub_cat.php?cat_id=<?php echo $fetch_cat['cat_id'];?>" style="color:#431603;text-decoration:none;"><?php echo stripslashes($fetch_cat['category_name']);?> </a> </li> <?php } ?> This is the output I am getting- alphabetical order horizontally: A B C D E F G H I J This is what I want to show- alphabetical order vertically: A E H B F I C G J D Please help. Thanks

    Read the article

  • Easy way to apply a function to an array

    - by alex
    I am aware of array_walk() and array_map(). However when using the former like so (on an old project) it failed array_walk($_POST, 'mysql_real_escape_string'); Warning: mysql_real_escape_string() expects parameter 2 to be resource, string given. So I went with this slightly more ugly version foreach($_POST as $key => $value) { $_POST[$key] = mysql_real_escape_string($value); } So why didn't the first way work? What is the best way to map values of an array to a function?

    Read the article

  • Getting an argument list for a class method

    - by Chris T
    What I'd like is for this class class Car { public function __construct(Engine $engine, Make $make, Model $model) { // stuff } } Get an array that has the types needed to construct this car (Engine, Make, Model) in the order they are needed for the constructor. I'm using this for a Dependency Injection-esque thing I'm making.

    Read the article

  • Removing part of a string in PHP

    - by Nik
    I'm trying to take a query: SHOW TABLES; which will display a bunch of tables with the chat_ prefix. I want to remove the chat_ prefix from the string, format the variable (with a link), and display it. How is this accomplished?

    Read the article

  • Framework or CMS for php web development?

    - by rocknroll
    Hi all, I am a C++,Unix developer who has never dabbled in web development apart from creating simple HTML pages. I am going to change that and develop a website at a personal level soon. I am going to use php,mysql on a linux machine. In this regard I am browsing through relevant literature. The language isn't a problem but reading about CMS's and frameworks is confusing. And since I am new to web development, the number of CMS's and Frameworks are overwhelming. ? My question is do I need to have knowledge of one or more CMS' and/or Frameworks like Drupal,Joomla,Zend,Wordpress etc. If yes which is the best open source CMS' and/or Framework suggested for a newbie. ?? If the answer to the above question is yes, does the choice changes if one delves into the realms of commercial web development? Note:- I will be developing on a Linux machine, using open source tools. Thanks in advance

    Read the article

  • Php read directory file

    - by kwek-kwek
    I have a script that goes through a directory that has 3 images $imglist=''; $img_folder = "path to my image"; //use the directory class $imgs = dir($img_folder); //read all files from the directory, checks if are images and ads them to a list while ($file = $imgs->read()) { if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file)) $imglist .= "$file "; } closedir($imgs->handle); //put all images into an array $imglist = explode(" ", $imglist); //display image foreach($imglist as $image) { echo '<img src="'.$img_folder.$image.'">'; } but the problem that I am having is it display a 4th img with no image.. yet I only have 3 image in that folder.

    Read the article

  • Make a router like zend

    - by Vahan
    I have a url http://*.com/branch/module/view/id/1/cat/2/etc/3. It becomes. array ( 'module'=>'branch', 'controller'=>'module', 'action'=>'view' ); next I need to get the params. Ihave this array. /*function getNextSegments($n,$segments) { return array_slice ( $q = $this->segments, $n + 1 ); } $params = getNextSegments(3); */ array ( 0 => 'id', 1 => '1', 2 => 'cat', 3 => '2', 4 => 'etc', 5 => '3' );//params And i wanna convert it to this one: array ( 'id'=1, 'cat'=2, 'etc'=3, ); How i can do this using php function. I know I can do using for or foreach, but I think php has such function , but i cant find it :(. Thank you. class A { protected function combine($params) { $count = count ( $params ); $returnArray = array (); for($i = 0; $i < $count; $i += 2) { $g = $i % 2; if ($g == 0 or $g > 0) { if (isset ( $params [$i] ) and isset ( $params [$i + 1] )) $returnArray [$params [$i]] = $params [$i + 1]; } } return $returnArray; } } This works normaly. If anybody has better login for this please help. Thank you again.

    Read the article

  • Deprecated: Function eregi() is deprecated, how to solve this error ?

    - by Jitendra Vyas
    I'm using this php code. but it's giving error Deprecated: Function eregi() is deprecated in C:\xampp\htdocs\fuel\emailcheck.php on line 7 <? include_once("mastersecure.php"); $emailcheck=$_POST["member_name"]; function isValidEmail($email){ $pattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"; if (eregi($pattern, $email)){ return true; } else { return false; } } if (!isValidEmail($_POST['member_name'])){ echo "The email is invalid!"; } else { $query="select email from fuel where email='$_POST[member_name]'"; $res=mysql_query($query); $rowcount=mysql_num_rows($res); if($rowcount!=0) { echo "This mail is already exits"; } } ?> Any solution for this?

    Read the article

  • Access a static variable by $var::$reference

    - by chuckg
    I am trying to access a static variable within a class by using a variable class name. I'm aware that in order to access a function within the class, you use call_user_func(): class foo { function bar() { echo 'hi'; } } $class = "foo"; all_user_func(array($class, 'bar')); // prints hi However, this does not work when trying to access a static variable within the class: class foo { public static $bar = 'hi'; } $class = "foo"; call_user_func(array($class, 'bar')); // nothing echo $foo::$bar; // invalid How do I get at this variable? Is it even possible? I have a bad feeling this is only available in PHP 5.3 going forward and I'm running PHP 5.2.6. Thanks.

    Read the article

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