php

Unexpected { expected ( ?

Parse error: syntax error, unexpected '{', expecting '(' in /home/a7237281/public_html/include/session.php on line 313 this is the error i get, relating to this code //check the emails $field = "email"; //Use field name for email $field2 = "email2"; if(!$subemail || strlen($subemail = trim($subemail)) == 0) { $form...

php include not working on IE?

This include is not working in IE: <?php include_once 'localization.php'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Global...

PHP exec - check if enabled disabled

I want to know if there's a way to check in a php script if exec() is enabled or disabled on a server.. Thanks! ...

how should i get ONE row from mysql? ( fetch_array etc? )

I'm pretty sure i'm doing an extra loop here: $q = "SELECT * FROM genres WHERE genre.g_url = '$genre_url' LIMIT 1"; $res = mysql_query($q); while ($r = mysql_fetch_array($res, MYSQL_ASSOC)){ foreach( array_keys($r) as $k ){ $g[$k] = $r[$k]; } } return $g; ...

PHP vs Phpmyadmin

Hi there, I've got this code which i execute on phpmyadmin which works 100% Create Temporary Table Searches ( id int, dt datetime); Create Temporary Table Searches1 ( id int, dt datetime, count int); insert into Searches(id, dt) select a.id, now() from tblSavedSearches a; insert into Searches1(id, dt, count) select b.savedSea...

double left MYSQL join?

I've been trying left joins but as there are 2 joins, i think the problem is the 2nd join roots from table_B not table_A. i am not getting any results where there is the required data in the db. I am not getting a query error the query (simplified) SELECT events.*, ven.*, events_genres.* FROM events LEFT JOIN ven ...

How to search mulitple value seperated by commas in mysql

Hi all, How to search multiple values separated by commas. ex: table name : searchTest id name keyword 1 trophy1 test1,test2,test3 2 trophy2 test2,test5 Points: If i search for test2 both results trophy1 and trophy2 should be display. If i search for trophy1 then trophy1 should be as result. How to solve t...

PHP open_basedir - to return value?

I want to return the value of open_basedir in a php script.. how can I do it? If value is blank it should echo that is blank.. Thanks! ...

AMFPHP AMF0 and AMF3

What are the difference between them? ...

change session property in zend

I made session using zend authentication it works good but my problem is I want to change some property of it from another action in other controller my code is: $auth = Zend_Auth::getInstance(); if($auth->hasIdentity()) { $blogId = new model_blog request; $auth->getIdentity()->user_current_blog = $blogId; print "Current Blo...

Can't get message body of certain emails from inbox using the Zend framework?

Hi guys I'm trying to read through an email inbox for my application - I'm using the zend framework here. The problem is that I'm unable to retrieve the message body for certain emails. The following is my code as to how I'm doing this: $mail = new Zend_Mail_Storage_Imap($mail_options); $all_messages = array(); $page = isset($_GET['pa...

So functions/methods in PHP are case insensitive?

function ag() { echo '2'; } Ag(); class test { function clMe() { echo 'hi'; } } $instance = new test; $instance->clme(); But that's the not case with variables, what's the rationale in it? ...

ampersand problem with wordpress categories

I have an array of categories, some with an & i.e. events & entertainment. My script imports these categories and gets the ID of each using its name. i.e.: $cat_id = array(get_cat_id($linearray[0]),get_cat_id($linearray[1]),get_cat_id($linearray[2]),get_cat_id($linearray[3])); My script then adds a post to wp using these category ID's. M...

Looking for a php template Parser with nesting

Hi Iam looking for a php parser that can do this. {tag} Replace the tag with text comming from a function {tag(params)} It must support params {tag({tag(params)},{tag(params)})} It must support nesting {tag()? else } It must support Tests {$tag=value} It must support varriables Do anyone of you know of an parser that can do thi...

Strange php problem

The following code: print_r($_GET); echo '<br />'; echo isset($_GET['logout'])?'yes':'no'; prints: Array ( [logoout] => ) no Why is it printing "no" instend of "yes"? ...

PHP & bash; Linux; Compile my own function

Hi. I would like to make my own program but I have no idea how.. for example I want to make a typical 'Hello $user' program. So.. ├── hi │   ├── hi.sh │   ├── hi_to.sh hi.sh #!/bin/bash ~/hi/hi_to.sh $1 hi_to.sh #!/usr/bin/php <?php echo "\nHellO ".$argv[1]."\n"; ?> Run it in terminal: me:~/hi → ./hi.sh User He...

create admin front-end for web application?

does one create an admin front-end from scratch for every web application (not CMS sites)? are there any tools for aiding this process? some tutorials? share your thoughts and experiences! ...

Loop through custom template hooking thing

Hi, I am building a template system for emailing people that currently works in the format of: $array['key1'] = "text"; $array['key2'] = "more text"; <!--key1--> // replaced with *text* <!--key2--> // replaced with *more text* For this particular project I have a nested array with this kind of structure: $array['object1']['nest1']['...

Problems with creating XML with DOMDocument in PHP

The below code is fetched from php.net (http://docs.php.net/manual/en/domdocument.savexml.php). My problem is - it doesn't work. My only output from this is: "Saving all the document: Saving only the title part:". What am I missing here? $doc = new DOMDocument('1.0'); // we want a nice output $doc->formatOutput = true; $...

Api/plugins for open source libraries?

whenever i use a open source library eg. Doctrine i always ending up coding a class (so called Facade) to use the Doctrine library. so next time i want to create a user i just type: $fields = array('name' => 'peter', 'email' => '[email protected]'); Doctrine_Facade::create_entity($entity, $fields); then it creates an entity with the ...