php

PHP and MYSQL SHOW 5 Rows

How do you get php to show 5 rows from mysql Then create a new line and show another 5 ect.... Thank you ...

Where can I get a complete list of all multi-byte functions for PHP?

Where can I get a complete list of all multi-byte functions for PHP? I need to go through my application and switch the non MB string functions to the new mb functions. ...

specifing text as bullets in list

I know in HTML you can use <ol><li></li></ol> to get a nice ordered list but doing that with list-style-type: decimal always increments the number by 1. I'm looking for a way to set the value of the bullet text. I might end up with a list that looks something like 12 item 22 item  2 item I don't want to do any crazy use of images ...

What do I need to send text messages with Kannel?

I want to be able to send text messages from Linux with PHP. I've read about and installed Kannel, a free SMS gateway. When I try to use the HTTP interface, it won't send a message. Do I need something else to send text messages via kannel, like a modem? ...

php http headers

Was wondering a couple of things. Does http headers cache everything on the page. And if i have some javascript files will it cache them as well for subsequent pages, or is it more complicated then that. Example: If I cache all javascript files on page1.php will the files still be cached on page2.php or does it cache files for page1.p...

PHP - Removing a forward-slash from the tail-end of an URL

Hello, The code below removes "www.", etc. from the beginning of websites that are entered into a database. It works great. Is there a way I could use similar code to remove a forward-slash from the tail-end of a website that is entered into the same database? Thanks in advance, John $remove_array = array('http://www.', 'http://'...

Simple PHP problem

<?php if (isset($_GET['action']) && (!$_GET['action'] == 'reply')) { ?> <div class="actions"> <input type="button" onclick="javascript: document.location='?threadID=<?=$threadID?>&action=reply';" value="Post reply" class="btn" /> </div> <?php } ?> What i wanna achive with this is to hide this when im callin reply. doesnt show at all. ...

Need help with my heap sort

I'm kind of stuck with my heap sort here in php: <?php function heapSort($a, $count){ $a = heapify($a, $count); $end = $count - 1; while ($end > 0){ $temp = $a[$end]; $a[$end] = $a[0] ; $a[0]= $temp; $end = $end - 1; siftDown($a, 0, $end); } return $a; } function hea...

How can I use Perl libraries from PHP?

I want to use Perl libraries from a PHP application. I have heard that it is possible. I have considered the possibility of re-writing the libraries in PHP, but I do not think that is a good idea because it is difficult. ...

Scripts(iframes and javascript) being added to site

My website is being hacked. iframes and JS is being added even after I have been manually searching for and removing them for the past couple of days. Why is this happening and what can I do to prevent it? I have set all index files to permission 444 and most other files to 644. There are a few pages that have flash content being added...

PHP - Pagination Picks Correct Number of Pages, But Doesn't Divide Up Rows

Hello, The code below is an attempt at pagination. It doesn't quite work. I am playing around with a result that has 49 rows. If I use $rowsperpage = 10;, the code below will correctly have hyperlinks to 4 pages at the bottom. However, it still displays all 49 rows on page one, and clicking on the subsequent pages returns a blank pa...

Php security question

Just had a thought post.php if (isset($_SESSION['id'])) { if (isset($_POST['comment'])) { insert() } <form method="post" action="post.php"> <textarea name="comment"></textarea> <input type="submit" class="btn" value="Submit"> </form> } $_SESSION['id'] needs to be set to access post.php. Is that safe enough? Just thinking maybe...

How do you get the 'referer' header in PHP?

I want the the url of the page from which a request has been made. How can I do that in PHP? ...

Imprecise numbers with microtime and floating point addition in PHP

I'm having a terrible time convincing myself what I've done here is a good idea. The specific section I find objectionable is: return ((float)($now+$sec).'.'.$mic); In order to preserve the floating point precision, I'm forced to either fall back on the BC or GMP libraries (neither of which is always available). In this case, I've res...

what is python equivalent to PHP $_SERVER ?

Hi, I couldn't find out python equivalent to PHP $_SERVER. Is there any? Or, what are the methods to bring equivalent results? Thanks in advance. ...

building unique bid site

i have a customer that want to build site of unique bid like : http://us.dubli.com/Unique-Bid__unique-bid_show.html i want to build it in LAMP environment. i do not have an experience in bid sites my question is : what important issues do i need to take in advance while building site like this. is there any open source existing syst...

[Zend Framework] Best way to store user desired language

I am currently developing a multi-language site using Zend Framework. The system will pick a language for the user when he enters our site. If he doesn't like the language chosen by our system, he can choose another language. What is the best way to remember which language the user is chosen? ...

$_REQUEST information not being passed through in IE

I am having a bizare problem where I have a script that works elsewhere on the site but refuses to work for me now. The problem is exclusive to IE, it works fine in Mozilla. Below is the form: <form class="element_form" action="general_image.php" method="post"> <?php generate_input('hidden', '', 'id', $id);?> <input type="image" src=...

Ordering items inside a table based on user preferences, what is the correct way?

After seeing joomla's way of having arrows to order items (articles, menu entries and the likes), I was wondering what is considered best practice to shift elements inside a table. You obviously must have a field inside a table that hold numbers, letters, or anything you may want to use to define an order, then you have to change this o...

Finding current page number in Wordpress

I have added a custom loop in my Wordpress template. WHich looks something like: <?php $args = array('category__not_in' => array($featured_cat->term_id), 'posts_per_page' => 10, 'post__not_in' => array($recent_post) ); query_posts($args); ?> For pagination to work, i guess i need to pass another arg 'paged'. And the value ...