php

PHP tags. How to minimize the tags usage in php script

I am using an ask answer script on a website and it converts the headline title words into the search query tags automatically. For example: "Who are you?" is converted into tags 'Who' 'are' and 'you' tags respectively. I want tags to be displayed only if the letters in the word are greater than 4. Is it possible? I am not into php but...

How to find "related items" in PHP

Hi, we often see 'related items'. For instance in blogs we have related posts, in books we have related books, etc. My question is how do we compile those relevency? If it's just tag, I often see related items that does not have the same tag. For instance, when search for 'pink', a related item could have a 'purple' tag. Anyone has any ...

how long does it take to write software?

First as an intro, I am not technical! meaning I do not program :-) although I can and have provided a detailed requirement documant it "seems" to me that the programmers are taking too long to produce the desired s/w First, I would like suggestions how is it best to know if they are on track. Secondly, how long does it take for examp...

What is ?: in PHP 5.3?

Possible Duplicate: What is the PHP ? : operator called and what does it do? From http://twitto.org/ <?PHP require __DIR__.'/c.php'; if (!is_callable($c = @$_GET['c'] ?: function() { echo 'Woah!'; })) throw new Exception('Error'); $c(); ?> Twitto uses several new features available as of PHP 5.3: The DIR constant The ...

How to remove  character

Hello, I got very strange problem. I have one php website which is running in two server. One is on Apache (Linux) and second is on IIS (WIndow). Linux Server, I just run it for demo. IIS is the actual hosting that I need to host. Even with all the same code, database, in the linux server, there's no  character. But in IIS, everywhere ...

Create php file with content from terminal

Hi there. I was wondering how, for example, cakePHP can use the terminal/command line to create files and put content in it. I guess they use some kind of template for the content but how do they do it? I know that you can create controllers and so on with it. Anyone know how it's done? / Tobias EDIT: I've been searching and searchin...

COMPARISON: MS ACCESS & MYSQL

In terms of capacity and performance in manipulating large amounts of data. Which is better, ms access manipulated by vb.net or mysql manipulated by php. ...

Retreiving two values for ajaxForm(), using jQuery and PHP

Hello, I want to pass both the values using ajaxForm, displaying both the values separately in test.php -------test.php----------------------------------------- <script language="javascript" type="text/javascript"> $('#test_form').ajaxForm({ target:'#result', success:function() { $('#result').show(); } }); </sc...

ERROR: duplicate key violates unique constraint "search6_idx1"

I'm trying to insert items into my postgres table via PHP But get the following error message ERROR: duplicate key violates unique constraint "search6_idx1" search6_idx1 is the index table for search6. I tried the following select setval('search6',45) and somehow that only works for sequences. Is there any way to solve this error? ...

PHP SESSION data lost between page loads with WAMPserver 2.0 on localhost

I have a PHP authentication system on my website using the $_SESSION variable. A form submits a username and password to the file "login.php". It is handled like this: <?php include '../includes/sessionstart.inc.php'; ?> <?php ob_start(); ?> if($_POST){ $q = mysql_query("SELECT id, company FROM users WHERE username = '".mysql_real...

Add working hours to timestamp

Hi, I need to add working hours to a timestamp. Working hours are from 8am to 6pm. Lets say we have 2pm and I have to add 6 hours. Result should be 10am... any guesses? Thanks. ...

help with PHP pagination

hello guys im using this second part of pagination script to show pagination; <? if ($pageno == 1) { echo "<li class='previous-off'>«« İlk Sayfa</li> <li class='previous-off'>« Önceki Sayfa</li> "; } else { echo " <li><a href='{$_SERVER['PHP_SELF']}?isim=$kid&sayfa=1'>«« İlk Sayfa</a></li> "; $prevpage = $pageno-1; echo "<li...

How to start a GET/POST/PUT/DELETE request and judge request type in PHP?

I never see how is PUT/DELETE request sent, how to do it in PHP? I know how to send a GET/POST request with curl: $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile); curl_setopt($ch, CURLOPT_COOKIEFILE,$cookieFile); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($...

php ADODB call mysql_options() before connection to MySQL

My application is using ADODB to connect simultaneously to 2 MySQL DB. Application is downloading large files; it takes a lot of time so "mysql has gone away" error takes place. I know that MySQL allows to use automatic reconnection which could be enabled using mysql_options(), but I have no clue how to apply this function to ADODB adap...

How to do multiple MySQL INSERTs in a way that scales (PHP)

We have a loop in our PHP code which inserts rows into a table. e.g.: while ($info = mysql_fetch_assoc($someQuery)) { mysql_query("INSERT INTO X (i,j) VALUES ($info['ii'],$info['jj'])"); } This was fine a few months ago because the loop would only iterate several times. However, due to our website getting more traffic this loop no...

how to identify IE error Messages

i m working on a php page where css, JS and Jquery is included. in Mozilla it show Error message on console or in firebug but in IE it display Line:1597 Char:9 Error:Invalid Argument Code:0 URL: blah blah blah now how do i know this error?? in fact there is no 1597 lines in my php code and if i extract all JS and CSS(included) then...

How do I consume a webservice returning complexTypes in PHP?

I am using PHP 5.2.10 and I am trying to consume a webservice which returns complex data types using the standard SOAP extension. The problem is that SoapClient does not populate objects which are nested into other objects / array of objects. A simplified example of what I get when I call the getUtente method, specifying "my_unique_id" ...

Contact form problem - I do receive messages, but no contents (blank page).

I have a contact form on site which used to work, but since last few months has stopped working properly. This could have been due to some coding error that I can't figure out. What happens is that I receive the messages sent, but they are completely blank, with no contents at all. What could be the problems? I'm attaching first the...

jQuery filtering and traversing (phpQuery)

Hi, I am trying to parse data off a page using phpquery(almost same as jquery), I need code to get these 2 things, B K Guda Association Hall and Main Road, C Type Colony, B K Guda other things can be left out.. this is the html <td> <a href="#..."> <span class="a12bl"> <u> <h2 class="bold">...

Truncate a multibyte String to n chars

I am trying to get this method in a String Filter working: public function truncate($string, $chars = 50, $terminator = ' …'); I'd expect this $in = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYXZ1234567890"; $out = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV …"; and also this $in = "âãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀā...