php

Getting a "Use of undefined constant" error that I cannot figure out

Hello, I'm getting the following strange looking error. Unexpected PHP error [Use of undefined constant s - assumed 's'] severity [E_NOTICE] in [C:\Documents and Settings\yepthatsme\My Documents\Dev\nicnames\main\resources\includes\name.inc.php line 180] The line it is referring to has: $types = nicnames_config::$resourcetypes...

PHP line breaks don't seem to work

I have the following code that sends a message using the mail() function. Everything works fine except the line breaks at the end of each line don't seem to work. As you can see I am using " \r\n " hoping that this will give me a line break but it doesn't I have added <br> to get the break, but I would rather not use that in case someone...

maked / hashed url param

I have created a quiz app which emails the user the results. I want to include a link in the url that the user can click on and view a breakdown of their results I want the url to look something like this: http://www.mysite.com/quiz/view/32k4k2u4vxcv88xcv8cv0x98c9v7c7v8887cv obviously a can't just hash the id cos that is easy to revers...

How to inject tag (<script> <meta />) inside the header in Joomla from a module ?

Well, almost all is in the question. From a newly created module, i would like to be able to inject new meta/script tag which will be added later inside the header when rendered. I'm pretty it should be a method to do this. Any ideas ? ...

How can i receive SMS through my web application ?

We are building a web App in PHP that should be able to receive SMS messages and store the information contained in it in database. Which methods have you used? Which service providers are out there that can assist? ...

How to log out an user in php?

Currently, in my php script, after an user logged in, i stored session_login = 1. But I have a problem. I have a habit in using firefox, multi-tab (i believe most people and all today web browsers app have multi-tab function). I closed the tab that has the session, but I didnt closed the browser. After few hours, I come back on the same ...

Accessing singleton methods in PHP

Hi, I'm just starting my journey into OOP - and I'm currently trying to roll my own MVC - purely for learning purposes. I'm working through a tutorial in the Apress PHP-Objects Patterns Practice book. I've created a registry singleton object using the private __construct/__clone technique: class Registry { private static $instance; ...

How do I create a new row without the table class in the Zend Framework?

I understand that you can have class Users extends Zend_Db_Table_Abstract and class User extends Zend_Db_Table_Row_Abstract, setting the $_rowClass property of Users to User. To create and save a new row, I only know how to do the following: $users = new Users() $user = $users->createRow(); $user->name = 'name'; $user->save(); Can yo...

PHP - how to use a session in place of the GET var

I have a dilemma going on here. I need to use a session to navigate records in a foreach loop. foreach($key as $val) { echo '<tr><td><a href="'.$key.'">$val</a></td></tr>'; } Ok, the $key in this equasion is my database key and when the user clicks the link, it will take them to the next page. This "next page" parses the data and pl...

PHP usleep/sleep inside output buffer

Hello, I have a PHP application containing these files: landing.php, redirect.php, ajax.php on a page call to landing.php, I execute a javascript code to capture certain data, and issue an AJAX POST to ajax.php which inserts them into DB. Finally php header() redirects to redirect.php Currently the above feature is using output buf...

Searching RSS feeds in Drupal...

I build a site on Drupal CMS and added some external RSS feeds. The search block works fine when i publish node, means it can search the nodes. But feeds are not stored as nodes so how do search the feed ? ...

What do I need to store in the php session when user logged in?

Currently when user logged in, i created 2 sessions. $_SESSION['logged_in'] = 1; $_SESSION['username'] = $username; // user's name So that, those page which requires logged in, i just do this: if(isset($_SESSION['logged_id'])){ // Do whatever I want } Is there any security loopholes? I mean, is it easy to hack my session? How does...

Rollback and Preview in a CMS

I am creating a CMS and am using serialize to handle publish and rollback, which seems to work fine. Basically, The normal site tables are what gets displayed and anything not displayed is serialized in a separate table. The problem however is in making the 'Preview' functions work. Since the front end is created using normal SQL ca...

Wordpress Theme Demo

Hey how do I showcase my themes like WooThemes has done. I don't want to use multiple databases and Wordpress installations? Can you suggest me any reliable solution which lets me use the same database for all themes. Thanks ...

how do i get accented characters to display in Fusion Charts graphs?

im using fusion charts to map data. the labels for the data are country names which we localise into languages that have accents, for ex österreich being german for austria. the data and labels are set in an xml file. for some graphs the accents show by using the decimal equivalent, so &#246; shows an ö. on other graphs the decimal, ent...

php chown file in remote server ssh2

Hi, I'm uploading one file from one server to other using ssh2_scp_send(). Everything works fine, the only problem is that I don't know how to change the owner and the group of the file after finishig the upload. How can I preform some kind of chown in the ssh2 ...

Convert UTF-16 hex to UTF-8 in PHP

I have the following output from strace and i want to convert it to UTF-8 using PHP: R\00f6dhakev\00e4gen 4 R\00e4ntm\00e4starv\00e4gen 24 K\00d8BENHAVN The above strings is UTF 16 HEX i think. ...

How to send more 5000 character to next page

Hi friends, I need to save a content into a file. The content is more than 5000 character. I cant able to send this through url as query string. Its showing Unspecified error. How to achieve this. I am using PHP here. So, i tried to send this content value's through ajax concept to another php file for storing. After a button click i wan...

Get called a subclass method from a superclass

Hi all, I have a big problem. How to get called subclass method from a superclass. Please execute below code. class Model { public function render(){ echo '<br />class: '.get_class($this).' -- function: '.__FUNCTION__; } } class Product extends Model { public function show(){ $this->render(); } } class User...

loop through $_GET results

Hi, If I had something like this: ?FormSub=Submit&qty=1&partno=ipod&notes=apple&unitprice=102.99&rowid=1&qty=2&partno=Ear+Buds&notes=Headphones&unitprice=45.99&rowid=2 Is it possible to loop through the GET's to return results into a HTML table and also add to a SQL table? Or would I need to add the rowid to then end of every $_GET ...