i am trying this to pass a value to the next PHP page:
$("#see_comments").attr({href: "comments.php?aid='"+imgnum+"'"});
and in the PHP file I am using:
$aid = $_REQUEST[aid];
echo $aid;
but this is displaying the output like this:
\'9\'
why is this happening?
//9 is the value i am passing.
...
Hello,
I think I am experienced procedural PHP programmer. I've implemented a few bigger projects. Now I would like to try OOP PHP on lesser one (framework for DB import/export + user authentication). Since I've never tried OOP on such a project I have problem with object design.
I would like to implement the framework the way, I'll ju...
I have a project management website running on PHP and MySQL. But I am not the person who developed it, which makes it harder for me to figure out what the problem is. So I turned to stack overflow.
When I try to sort a list of objects, MySQL server throws an exception at me, saying:
"You have an error in your SQL syntax. Check the ...
hi,
i need a php function to extract domain with tld from a url or domain with tld and subdomain if there is.
example:
http://minova.tumblr.com/post/145515 >> minova.tumblr.com
http://www.tumblr.com/about/1 >> tumblr.com
Thanks
...
I'm trying to open a text file and output its contents with the code below. The text file includes line breaks but when I echo the file its unformatted. How do I fix this?
Thanks.
<html>
<head>
</head>
<body>
$fh = fopen("filename.txt", 'r');
$pageText = fread($fh, 25000);
echo $pageText;
</body>
</html...
According to many sources, register_globals (global variables that is) should be disables in your php.ini.
Should I write define() in my code and use constants if global variables are disabled? Are those even related?
...
Hello.
I am writting my own small framework and I am going to implement friendly URLs there. mod_rewrite is great. But I want to be able to handle several types of friendly URLS at once:
/index.php?ac=user&an=showprofile (fallback variant, the worst)
/index.php/user/showprofile (supposedly, can be disabled by security settings)
index.p...
Hi,
I have been trying to figure out a way to list all files contained within a directory. I'm not quite good enough with php to solve it on my own so hopefully someone here can help me out.
I need a simple php script that will load all filenames contained within my images directory into an array. Any help would be greatly appreciate...
Hi,
I have a class that performs database operations and returns results (array, true, false). And I have an another class that creates JSON string by using this class in its constructor.
Can we say this class is an Adapter? Or simply wrapper or ...
Class Db
{
public function getRows($params)
{
//...
}
}
Class DbAd...
hello.
i want to know from the syntax if a url is a picture or not.
example: http://www.blah.com/plo52.jpg or png or gif will return true.
if the url is ending with other extension, the function will return false.
Thanks
...
i am experiencing some weird behaviour here.
i am using the following code to reference the facebook api.
$query = "SELECT msg, user_id, comment_time FROM comments WHERE aid = '$aid' ORDER BY comment_time DESC";
$result = mysql_query($query) or die("ERROR: $query.".mysql_error());
if (mysql_num_rows($result) > 0) {
...
This script crashes apache. I removed url on purpose. Can anyone take a look and offer alternatives? Thanks!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/h...
I'm in a bit of trouble and need to run a linux command as sudo using php. Is this possible using php's exec()? I've tried but cannot enter the sudo password and then execute another command on the same exec() call.
edit: i cannot access the server remotely via ssh due to own stupidity. That's why i have to run commands thru the web ser...
When I delete a record from the database, even when it is successful, all I ever get is int(0). What am I doing wrong? The manual does not give an example of this with a procedure.
$foo = db::getInstance()->exec("CALL deleteUser(222)");
...
All,
I want to send a variable "itemId" via GET to a controller action through AJAX. In the Controller Action, I should be able to retrieve the value using $_GET["itemId"];
Can I send the querystring with "data" tag instead of appending it to the "url"?
I have the following code:
$.ajax({
type: 'GET',
url: "/con...
Hi
I am trying to add a list of words to be censored.
So I found this site
http://www.phpbbsmith.com/projects/phpbb3/word-censor-list.html
that does it for phpBB. I downloaded the file and I put it in my root folder.
I get this error
Fatal error: Call to a member function session_begin() on a non-object in C:\HostingSpaces\SomeName...
I want to use GD library in my PHP script to generate a small thumbnail of a random big picture from external server. Every time the page is called, the GD library will regenerate a thumbnail and show it.
Will this slow down the server or use up an unusual amount of memory?
...
I have this query and if it returns successful, I want another function to process, if not, do not process that function.
Here is the code for running the query
global $DB;
$DB->query("UPDATE exp_members SET group_id = '$group_id' WHERE member_id = '$member_id'");
I imagine it is something like...
if($DB) {
//success
} else { ...
What are the recommended libraries for XML in PHP? Advantages? Looking to create/send/parse XML. Needs to support High Volume (Millions of calls per day)
...
i am using this to collect comments made abt a particular user. i want to display 7 comments on each page and want to enable pagination.
what would be the steps of implementation. sorry. n00b question.
$query = "SELECT msg, user_id, comment_time FROM comments WHERE aid = '$aid' ORDER BY comment_time DESC";
$result = mysql_query...