Hi everybody!
Here's my problem: I have 3 MySql tables representing: photos a user post, videos a user post, comments a user post and I need to view the 10 (20, 30, 40...) most recent activities by the user.
For example in photos table may be composed by:
user_id | photo_id | photo_path | photo_name | date_added
5 | 18 ...
I am building a web site in PHP that integrates with Youtube. I want to have access to all comments that have been posted on a particular video.
When I use the Zend library, I can get the video comments feed, using the getVideoCommentFeed() method, but that returns only the latest comments.
Is there a way to get every comment that has ...
Anyone know how can I check the php SimpleXmlElement Object for errors?I mean if is an valid XML file?I have read the manual a lot..but i don't get it!
Best Regards,
...
INFO:
I have an Array of 100 nodes, [ 0 .. 99 ]. Each node can have an arbitrary number of linked nodes:
eg1, 0 links to 5, 10, 15, 20.
eg2, 1 links to 30, 40, 50.
eg3, etc..
All 100 nodes have at least one linked node, nodes do not know who links to them.
QUESTION:
How can I find the shortest link-path if provided with START and END...
In a PHP script, what regex should I use to check for mismatched parentheses in a string? Things that I want to allow include:
This is (ok)
This (is) (ok)
Things I want to prevent:
This is )bad(
This is also (bad
This is (bad (too)
Thanks!
Update: You guys all rock. Doing this with a regex seemed trickier than it should have,...
This is the case when it "works on my machine". Except that my machine is Windows, and the target is some sort of Linux.
The idea is that the mail() function puts a newline between the MIME-Version and Content-Type headers, thus breaking the whole thing. Here's the code, simpliefied as much as possible:
<?php
$HTMLPart = chunk_split(...
I want to match an input string to my PHP page the same way a match done by the LIKE command in SQL (MySQL) for consistency of other searches. Since (I have seen but don't comprehend) some of the PHP syntax includes SQL commands I am wondering if this is possible?
The reason for this is I am now implementing a search of a keyword versu...
HI,
I have a file test.php with the following code:
<html>
<head>
<title>Listing 10.2 </title>
</head>
<body>
<div>
<form method="post" action="test.php" >
<p> <input type="text" name="guess"/> </p>
</form>
<?php
if(!empty($_POST['guess'] )) {
print "Last guess $_POST['guess']";
}
?>
</div>
</body>
</html>
I have a problem wit...
We have a web page (HTML javascript and PHP mostly) that allows a user to upload an image. We have the normal browse button, and it works fine. However, we want to add the functionality to drag and drop an image into the text field instead.
gmail allows you to do this in their mail app, so it's possible. The only way we've thought of to...
I am writing a calendar/scheduling app in php right now. Right now I take the day of the week you want the event to occur on and the time. I also ask for the timezone and adjust accordingly to get the event time in GMT. Then I store that time as an offset from midnight of the day of the show. This is fine and works great, but what ha...
The hosting service that I use currently does let me use sockets, probably for good reason on their part. They do, however, let me use fsockopen. I was wondering what the difference is, because some scripts that worked with socket_create and even stream_socket_server, do not work with fsockopen. That said, if fsockopen should work, my co...
I'm having trouble getting phpThumb to generate thumbnails on WAMP. The problem seems to be that the path to the source image is be being constructed incorrectly, as indicated by this debug info:
DEBUG phpThumb: ResolveFilenameToAbsolute() prepending $this->config_document_root (C:\Projects\WordPressTest\Site\wp-content\plugins\yet-anot...
I'm a beginner with PHP, I was exposed to processed HTML forms and I'm learning how to use it to do more and more...
I'm using this function (and based on Google so are a lot of people) but I really want to understand what it's doing....
function pt_register()
{
$num_args = func_num_args();
$vars = array();
if ($num_args >= 2)...
Hey All,
What is causing this error?
Fatal error: Call to undefined function imagefilter() in /var/www/polaroid.php on line 5
1 <?PHP
2 $img_addr = $_GET['image_address'];
3 $img = imagecreatefromjpeg($img_addr);
4
/* everything works as expected without this line */
5 imagefilter($img, IMG_FILTER_GRAYSCALE); ...
For a school project I have to produce a website using PHP that allows user to generate there own article or comment on news or others articles. I was wondering how it is best to use the GET function to show the content in an include file and also use the get fuction for other include files such as the login page and other content the de...
I'm trying to read an Excel file (Office 2003). There is an Excel file that needs to be uploaded and its contents parsed.
Via Google, I can only find answers to these related (and insufficient topics): generating Excel files, reading Excel XML files, reading Excel CSV files, or incomplete abandoned projects. I own Office 2003 so if I ne...
Are there any differences between these?
if ($value) {
}
if ($value):
endif;
I think the second way is new to PHP 5.. therefore is it better because it is newer?
Update
I have been informed that the second way is not new.
...
This is more of a generic regex question than a PHP-specific one.
I am given different strings that may look like:
A/B/PA ID U/C/D
And I'm trying to extract the segment in the middle slashes that has spaces ("/PA ID U") using:
preg_match('/(\/PA .+)(\/.+|$)/', '', $matches);
However, instead of getting "/PA ID U" as I was ex...
I prepared 2 files, "1.php" and "2.php".
"1.php" is like this.
<?php
$dbh = new PDO('sqlite:test1');
$dbh->beginTransaction();
print "aaa<br>";
sleep(55);
$dbh->commit();
print "bbb";
?>
and "2.php" is like this.
<?php
$dbh = new PDO('sqlite:test1');
$dbh->beginTransaction();
print "ccc<br>";
$dbh->commit();
print "ddd";
?>
and...
Hi,
My PHP script have to create a multi-tabs Excel file with a report in each tab, but those reports already exists as HTML pages, so I don't want to duplicate code and work.
I know I can rename a HTML file to .xls, and Excel/OpenOffice Calc will open it as a spreadsheet, but I don't know how to have severals tabs.
I do not even know...