I have a problem with the toArray() method in Doctrine. Its doesn't get my relations:
First query :
$q = Doctrine::getTable('posts')->find(1);
debug($q->toArray(true));
Print the postid=1 with out the relations
$q = Doctrine::getTable('posts')->find(1);
$q->Tags->toArray();
debug($q->toArray(true));
...prints the results with tag ...
I want to add a user in users table via link like '/index/adduser/id/7' .
Question
Should I validate user input inside 'adduserAction' function inside controller or somewhere inside model file? I've put files containing database related functions inside 'models' directory. Suppose a user is added to a table via 'id'. This id is sent vi...
I have a permalink working but as soon as I create a post it tells me that soory post not found permalink setting is to "/%pagename%/" and here is .htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ryan/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
R...
Hello, I want to use something like this in a PHP file:
$about = array ('dutch' => 'over', 'spanish' => 'sobre', 'english' => 'about');
if ($USER['lang'] == 'dutch'){
// $about - becomes 'over'
}
elseif ($USER['lang'] == 'spanish') {
// $about - becomes 'sobre'
}
else {
// $about - becomes 'about'
}
And transfer the outcome to...
Hello everybody, I'm trying to make comments on my page just like the ones in wordpress. When you press post comments your page updates without reload. How can I do that?
I understand I have to use jquery post, and I've had several attempts but for some reason my web page keeps reloading. I have a form like this :
<form name="postForm...
I have a footer in a web page, the footer is called footer.php. I'd like the footer to have a different image depending on other variables. I want to do something like this:
if (x=1) {include (str_replace('logo1.jpg','logo2.jpg','footer.php'));}
else
{include 'footer.php';}
But this doesn't work, it just does a regular include. Is ...
I have installed the TinyMce blog editor to my site. When the compose blog page loads a I get a pop up that has the yield sign and says "Developer Key Validation Failed" Anyone know what this is?
<script type="text/javascript" src="javascripts/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="http://www.cysticlif...
if we say:
$termstringDomain1 = "something";
$url = "somethingelse";
$url = 'http://' . $termstringDomain1 . '/' . $url;
the result if gives me is: http:///somethingelse instead of http://something/somethingelse
so basically it is ignoring $termstringDomain1
Any idea why?
...
I am currently working on a plugin for Wordpress involving lots of .php files. I see that for my AddShift.php file, we are successfully importing the blog header using the following line of code:
include("../../../wp-blog-header.php");
However, when I try to do the same thing in my ajax_cal_split.php file, I get the following error:
...
I'm using Oracle 10g Express on Windows XP, and on a Macbook OS X 10.5.8 running PHP 5.3.1 with PDO and Oracle Instant Client 10.2.0.4.0_4, I run the following script:
<?php
$pdo = new PDO("oci:dbname=winders:1521/xe", "system", "XXXXXX");
...
$sql = "WITH NumberedBugs AS (
SELECT b.*, ROW_NUMBER() OVER (ORDER BY bug_id) AS RN
...
Is it possible to recieve only the structure of the table even if its emtpy and put the field names in an array. if so wich sql command makes that possible.
thanks
Matthy
...
Im wondering if its good practice to pass-by-reference when you are only reading a variable, or if it should always be passed as a value.
Example with pass-by-reference:
$a = 'fish and chips';
$b = do_my_hash($a);
echo $b;
function &do_my_hash(&$value){
return md5($value);
}
Example with pass-by-value:
$a = 'fish and chips';
$b ...
I have a string that looks something like this:
Bürstner
When I use htmlentities() on it, I set the double encode param to false, but it still ends up re-encoding the into &nbsp;
I'm using this to encode:
$out = htmlentities($string,ENT_NOQUOTES, 0);
Am I somehow misunderstanding how this works? The desire...
When passing data to another PHP script using Get or Post, should I encrypt it with a MD5 with salt? or is there a better way to do it?
...
I've got a string :
$source = '&
<script type="text/javascript">&</script>
&
<script type="text/javascript">&</script>
&';
The desired result is :
&
<script type="text/javascript">&</script>
&
<script type="text/javascript">&</script>
&
I try with :
echo preg_replace("#&(?!amp;)(?!<\/script>)(?![^<]script.*?>)#i",
...
Thanks to Anthony's advice I've tried to simplify my logic and syntax of the goal I am trying to achieve which is when a blog is written, the AUTHOR gets notified by php mail that someone other than himself comments. When the AUTHOR comments everyone else who commented except him gets a different email. When another user comments, the AU...
Hi,
The attached code is returning "Notice: Array to string conversion in...". Simply my array is being handled to the remote server as a string containing "Array" word. the rest of the variables are fine.
How can I pass my array ($anarray) without this problem?
Thanks.
<?php
$data = array(
'anarray' => $anarray,
'var1' => ...
I've been trying to use
$string="The Dr. is here!!! I am glad I'm in the U.S.A. for the Dr. quality is great!!!!!!";
preg_match_all('~.*?[?.!]~s',$string,$sentences);
print_r($sentences);
but it doesn't work on Dr. , U.S.A., etc..
Does anyone have any better suggestions?
...
Hello, I was searching in Google this question very much time but I don't find any answer.
I want to rewrite http_//mydomain.com/f to http_//mydomain.com/
This is my .htaccess code:
Rewriterule ^f$ / [R=301,L]
rewrite works, but if exists a file called f.php, then doesn't work
I tried to do this:
RewriteCond %{REQUEST_FILENAME} !-...
I'm trying to debug using PDT and Xdebug over a tunnel and haven't been able to get PDT to connect properly. I do not have PHP installed on the machine I am developing on and would like to connect to the XDebug instance that is running on my development machine that is not able to talk directly with my machine.
...