php

Is there an easy way of interpreting PHP code within an HAML file?

Currently this is how I write a php file using Haml: %ul#nav %li %a <?php echo l('nav1'); ?> Output: <ul id="nav"> <li><a><?php echo l('nav1'); ?></a></li> I which I could have something like this: %ul#nav %li %a=$nav1 I checked pHaml and phpHaml but coudn't figure out how to use it, and I saw th...

database suddenly no response after modify process file

hi all..i've a problem my database become no response..i'm using one page process for many form..last time it can works normally,where is my fault: switch(postVar('action')) { case 'newinputdata' : newinputdata(postVar('modelnm'),postVar('serialno'),postVar('faline'),postVar('shift'),postVar('insp_date'),postVar('range_sampl'),p...

Autofill a username and password

I would like to be able to click a link in Website A that will autofill a username and password into Website B. Can anybody provide me some ideas how to do this with JavaScript or PHP? Many thanks! ...

How to Create your own print Function PHP

Is there any way we can create our own print function in PHP so when using it we can do the following my_print_function "My Content"; rather than my_print_function("My Content"); ...

Php file renders blank after being converted with Haml (Ruby)!

In order to test if the converted index.haml would work on with my wamp and localhost i did the following: First, I renamed my index.php into index.html Then, I typed html2haml index.html index.haml in the command line Then, I typed haml index.haml indexnew.html in the command line I renamed indexnew.html to indexnew.php I tested it: l...

calling class method (with constructors) without object instantiation in php

Hi everyone, Ive looked and tried but I can't find an answer. In PHP, is it possible to call a class' member function (when that class requires a constructor to receive parameters) without instantiating it as an object? A code example (which gives errors): <?php class Test { private $end=""; function __construct($value) {...

Install propel_generator 1.2?

I'm trying to install propel_generator version 1.2 (later versions are incompatible with the project I'm working on). I've tried pear install propel/propel_generator-1.2 But I get the following error: Failed to download propel/propel_generator, version "1.2", latest release is version 1.5.2, stability "stable", use "channel://pear....

How to get my client to ping server?

Hello, I'm trying to figure a way where my clients can ping my server via php, and then retrieve the results into format like this "15 MS". I ended up finding a way where servers can ping servers. However I want to be able to have the remote user somehow ping the server, or maybe have the server ping the client possibly? function trac...

alert beep sound new user comes

hello... i am doing private chat concept. i want to alert beep sound when new user comes in. how to do? i am displaying every thing when new user comes in user details will comes at admin side. but at the same i want to alert beep sound when new user comes. ...

Implementing order in a PHP/MySQL CMS & dealing with concurrency.

I have the following tables: ======================= ======================= | galleries | | images | |---------------------| |---------------------| | PK | gallery_id |<--\ | PK | image_id | | | name | \ | | title | | | description ...

Replace Links Location (href='...')

Hello, I would like to replace the link location (of anchor tag) of a page as follows. Sample Input: text text text <a href='http://test1.com/'&gt; click </a> text text other text <a class='links' href="gallery.html" title='Look at the gallery'> Gallery</a> more text Sample Output text text text <a href='http://example.com/p.php?q=...

Database class in PHP; only has one function - question about practices and whether it's a good idea

So I have this database class in PHP and I only have 1 function in it (other than __construct and __destruct. Let me explain further... I had originally written it so when I connected to a database I would just call my function connect_to_db() which returned a mysqli object. I then used this objects functions (->query(), ->prepare(), -...

show PHP Fatal error after combine date and time

i have two textfield..one for show datepicker and another one for time.. but i want after input to DB they can combine become one field inside DB..so that i set field type as datetime... to make them combine..i'm doing some manipulation inside process.php page..this is my code: $sql = "INSERT INTO inspection_report "; $sql.= "(Model,Se...

PHP: Why such weird behaviour when I include a file from another directory which also includes a file???!

I've never seen anything like this. File structure: somefolder/base.php includes/stuff.php includes/constants.php base.php: <?php require("../includes/stuff.php"); ?> stuff.php: <?php require("constants.php"); echo "Welcome to stuff.php"; ?> constants.php: <?php echo "IMPORTANT CONSTANTS DEFINED HERE!"; ?> Result:...

Could someone explain me this while loop for PHP?

Could some one explain me this while loop? while (list($key, $value) = each($HTTP_GET_VARS)) { $get_url .= $key . '=' . $value . '&'; } I know its silly but many times silly things makes huge difference.... ...

php form data send to two different action

i have a form, i want to send form data to two different action, can I do that in php ...

...

    how to display multi table data in one page like facebook news feed

    how to display multi table data in one page like facebook news feed. example tables /event,task/ i want to sort by datetime new in top.i can do it by php.i need mysql way /Sorry for my english/ event.row1 task.row1 event.row2 task.row2 event.row3 task.row3 ... older ...

    Appending easy read parameters to urls always require that 'index' be preappended - help

    Hi guys I'm using zend framework here and I've enabled url-rewrite so all my urls are clean. The thing is that I've incorporated pagination of results on some pages and I want to append parameters to the url in this form: www.mysite.com/controller/page/2 However I can't do it without appending the default action i.e index to the end ...

    PHP, explode, and my trouble

    Can't wrap my head around this... Say, we explode the whole thing like so: $extract = explode('tra-la-la', $big_sourse); Then we want to get a value at index 1: $finish = $extract[1]; My question is how to get it in one go, to speak so. Something similar to this: $finish = explode('tra-la-la', $big_sourse)[1]; // does no...