php

Looking for a quick and simple way to add comment funtionality to a web page.

My little brother just asked me to help him add a comment functionality to his web page. The server has PHP5 and MySQL. What I'm looking for is a way to help him out without actually having to do too much work. He wants the comments to be integrated into a existing page, but it doesn't mater if the solution is self hosted or a third p...

New to PHP/MySQL

I'm a recent CS graduate and have learned very little on 'web 2.0' type stuff, we mainly focused on Java and C. I want to get into PHP, what would you guys recommend as the best book/website to get started with? There are a lot of them out there, and I don't want to drop 50 bucks on something that will finish with a hello world program. ...

Php and macros(lisp style)?

Hi im learning LISP and well, all day i program php for a living, so i was messing around with php.net and found the eval function... so i started playing around! I would love to know more about how to use eval to do crazy stuff, i know you can make functions with this and everything... but i wanted to ask why the next code wont work: ...

Best practices for bit flags in PHP

I'm writng a small application in PHP + MySQL and have come to the point where there is an object that has a couple (8 so far but not expected to increase) of flags associated with it. The flags are pretty much unrelated although there are some combinations that would make no sense. The object represents a row in a DB (has some methods f...

Confused how to write this simple UPDATE/INSERT

OK, I'm confused how to write an INSERT/UPDATE for this simple app I'm developing locally to learn more about db interactions. I have an "edit" page, which is populated from the db and lists up to 9 user links (user_id 2 in this case), so something like: <input type="text" name="link1" value="www.yahoo.com"> <input type="text" name="...

Array posting in PHP

I am trying to post an array full of checkboxes and to open it in the next page.. It only gives me the last result, anyone know why? or how to fix it? <form name="input" action="createevent.php" method="post"> Event title: <input type="text" name="Eventtitle" size="20"> <br>Event Description <input type="text" name="Description" siz...

Pulling Data from a Mysql Table Field and putting it into an array

I can find lots of tutorials showing you how to load an array into a database field but can't seem to figure out how to pull each entry in a field into an array as seperate items. Seems simple enough just can't get it to work, any help? ...

why is the iframe contents empty?

Hi All. I'm trying to understand this bit of code: in display.php: <html> ... <body> <table> <tr> <td> User info: <iframe id="SpControlFrame1" name="SpControlFrame1" src="javascript:'';"path_src="index.php?cmd=YYY" ></iframe> </td> </tr> </table> </body> </html> in another file, I have a sw...

What are good references for Perl programmers who want to learn PHP?

I know Perl quite well, but have not worked with PHP. Any books or references that are targeted to people who know Perl and want to start using PHP? ...

What is your PHP development environment configuration?

Hello, I've found some resources here about what is the best IDE for PHP. But they don't have a answer for my question. I would like to find an answer how to create rich and functional development environment configuration to create PHP web apps. What I think would be necessary to gain power in this area is: Code Completition Syntax ...

How can I programmatically read server logs from HLDS?

How does one go about reading and parsing server logs sent remotely from HLDS (Half-Life Dedicated Server)? My understanding is that you can specify where the server delivers logs using the command log_address. After this, the server is supposed to deliver the logs via UDP. How can I go about listening for these logs with either PHP o...

PHP: Holding two matching items in an array of data from MySQL

$story_query = "SELECT table_name, id FROM planning WHERE parent = '$novelnum'"; $story_result = db_query($story_query); while($story_row = db_fetch_array($story_result)) { $taleTable_Name = $story_row['table_name']; $postid[] = $story_row['id']; $q2 = "Select * from $taleTable_Name where approved='Y' order by id"; $bset...

Basic php form help - referer title

I now have it set up so that when people go to a "thank you" page after filling out a form, they go to a page that says: thanks for coming <a href="<?php echo $_SERVER['HTTP_REFERER'] ?>here's a link back to where you came from</a> What I want is for it to say: thanks for coming <a href="<?php echo $_SERVER['HTTP_REFERER'] ?>h...

PHP Pull Image And Display

I have a PHP file which I have used mod rewrite to make a .jpg extension. I want to grab an image from a url example: http://msn.com/lol.gif take the data and then display it in my .jpg with jpeg headers, so as far as the user is concerned it is a normal image. Is this possible and if so can anyone give me some pointers? ...

Hyperlink works - Html Form with a Submit button doesn't

I have a PHP script that pushes the headers to allow a file to download. This script works fine when it called via a hyperlink or through the browser using link. This is how it looks like: <a href="download.php?file=test.mp3&properFilename=Testing File">Download</a> I want this to be a button (sbumit) instead, so I did this: <form ac...

What is the most efficient way to give the active page's menu item a "selected" id to change the CSS?

Lets say I have 5 pages: A, B, C, D, and E. I also have a horizontal menu, and each item has a light gray background. Each menu item has a:hover that gives it a medium-gray background, but I want the active page to have a black background, so I define #black { background-color: #000; } Now when the user is on B.php, I want the B ...

How can I extract images from a PDF file?

I need to extract all the images from a PDF file on my server. I don't want the PDF pages, only the images at their original size and resolution. How could I do this with Perl, PHP or any other UNIX based app (which I would invoke with the exec function from PHP)? ...

Performance benchmark: PHP Generated content VS. javascrpt and DOM over AJAX

Hi, For the following pretty straightforward task: query a list of products from a DB and present it on a webpage, consider 2 setups: Setup1: PHP script queries. All content is built on the server and the entire page is served back to the client. Setup2: Static HTML "page skeleton" requesting content using AJAX. Received content is pa...

What's the best way to manage dates across PHP, MySQL, etc?

My server is in Dallas. I'm in New York City.. and both PHP and MySQL have configuration variables for setting the timezone. How do I get them all to work together? What dates should I store in MySQL? How do I get PHP to handle changing the date based on the user's preference? Bear in mind: I don't think I'm ever having PHP explici...

PHP/Apache blocking on each request?

Ok, this may be a dumb question but here goes. I noticed something the other day when I was playing around with different HTML to PDF converters in PHP. One I tried (dompdf) took forever to run on my HTML. Eventually it ran out of memory and ended but while it was still running, none of my other PHP scripts were responsive at all. It...