Okay, I am new to PHP/Oracle connectors. What I am trying to do is call a simple stored procedure which accepts a id number and returns a value. It works fine if there is a match, but I can't for the life of me figure out how to add conditional logic if there isn't a match. Basically, if there is a match, set $strategy to it, if there ...
I'm considering changing some PHP code to use PDO for database access instead of mysqli (because the PDO syntax makes more sense to me and is database-agnostic). To do that, I'd need both methods to work while I'm making the changeover.
My problem is this: so far, either one or the other method will crash Apache.
Right now I'm using XA...
I'm using SESSIONS to store data from a database when a user logs in. However, when I query a database on another page the SESSION variables change without me assigning new values to them.
Does anyone know what the problem could be?
The login page that saves the variables:
enter code here
session_start();
if($_POST['login_but...
I might be going about this the wrong way
I have a landing page that has a form on it. When i post that page the values of the from got to a page called mail.php
I wanted to add a captcha ( in this case re-captcha.com) to the first page to prevent people from spaming my job application site.
I am unsure how to use the php captcha to p...
I believe that in properly coded systems - errors (as errors or exceptions) should not be possible (with the exception of a DB/memcached server going down causing a query to fail). Our code should not rely on any assumptions to properly work and should be as bullet proof as possible.
However, in order to insure that our systems handle ...
I can't get the following code to display items from the database where the parent_id is equal to the id.
Here is the code below.
// Query member data from the database and ready it for display
$mysqli = new mysqli("localhost", "root", "", "sitename");
$dbc = mysqli_query($mysqli,"SELECT * FROM categories WHERE id=parent_id");
if (!$d...
How would I use the apc.filters parameter in APC opcode caching to not cache certain paths? For example, I want caching to be active for anything under the path:
"/var/www/vhosts"
and exclude paths like
"/usr/share/psa-horde/"
I tried using
apc.cache_by_default = 0
apc.filters = "+/var/www/vhosts"
and
apc.cache_by_default = 1
apc...
Hello,
In my CI system\libraries directory I have a new class named DD_Controller.php. This file looks like this:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class DD_Controller extends Controller
{
protected $ddauthentication;
function __construct()
{
parent::Controller();
...
Hi again... I have tried different solutions but none of them work... So here is my last shot, if there is anybody out there who have done this or knows a way to do it please help me out...
I have two divs, one on the left, and one on the right side of my page.
I have an iframe in the middle of my site, which content is loaded from a ph...
The question:
Is there a way to view the XML that would be created with a PHP SoapClient function call BEFORE you actually send the request?
background:
I am new to WSDL communication, and I have a client who wants me to develop in PHP, a way to communicate with a WSDL service written in ASP.NET. I have gotten pretty far, but am runni...
Example to save gender
<form action="save.php?id=<?=$id?>" method="post">
<p><label><input name="gender" type="radio" value="male" <?php if($gender=='male'){?>checked="checked"<? }?> /> Male</label></p>
<p><label><input name="gender" type="radio" value="female" <?php if($gender=='female'){?>checked="checked"<? }?> /> Female</lab...
Hi,
I'm building some simple validation rules in php and my IDE (phped) is complaining about the syntax.
Can anyone tell me what is wrong with the following?
function notBlank($str) {
(strlen($str) == 0) ? return false : return true;
}
phped complains of 'unexpected return'
Any advice appreciated.
Thanks.
...
I want to parse a large XML file and I have two options: Perl or PHP. Being new to both languages what would be your suggestion about language of choice for parsing a large XML file?
And what modules are more appropriate for the task at hand?
...
Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to latest version of jquery & jquery form and still having same issue.
This is the error in firebug
too much recursion
[Break on this error] (function(){var l=this,g,y=l.jQuery,p=l....each(function(){o.dequeue(this,E)})}});\n
And in IE8 it's a popup...
Hello i want to refresh my php every 3 sec this is what i have:
<?php
session_start();
include "../config.php";
$time = time();
$sql1 = "UPDATE login SET lastlogin = '" .$time. "' WHERE id = '" .$_SESSION['userid']. "'";
$res1 = mysql_query($sql1) or die(mysql_error());
$onlinetime = "10"; // 10 seconds
$sql3 = "SELECT * FROM log...
Hi,
I have three classes that all have a static function called 'create'.
I would like to call the appropriate function dynamically based on the output from a form, but am having a little trouble with the syntax. Is there anyway to perform this?
$class = $_POST['class'];
$class::create();
Any advice would be greatly appreciated.
...
In the project my team is currently working on, we're modifying a commercial PHP application. The app is strewn with code where a parent class checks for and works with a property that doesn't exist in the parent class, like so:
class A
{
function doSomething()
{
if (property_exists($this, 'some_property'))
{
...
say a ruby script is running
ruby.rb SOMEUSERID
using PHP, how can i find out whether something exactly like that is currently running or not ? Currently i am using PID to check but im not sure if this is efficient. What if there are lot of users running the ruby script, and the ruby script unexpectedly closes. The php script now looks...
Here is a link to the tutorial that I am referring to.
This seems strange to me...in the view script we have this code:
<?php echo $this->escape($entry->email) ?>
This displays the email address that has been set in the Guestbook model. But the property on the model is $_email and it is protected. We're not calling $entry->getEmail()...
For class, I would like a to use PHP MVC framework very similar to ASP.NET MVC with NHibernate. I am very comfortable with ASP.NET MVC. I need to use PHP and MySQL. I would not like to be concerned with the SQL to save me time. I would like to just design my PHP model classes and controllers without all of that data-access logic behind i...