I have a table for articles. Its major fields are
id
article_name
content
tags (its values will be comma seperate example test, abc ...)
Now when I am on a detail page of any article. I want to show related article in my sidebar. For this if any other article uses the same tag as current article. I want to list those articles as related...
Possible Duplicate:
Access global variable from within a class
I got the following code:
$foo = 'foo';
class bar
{
public function __construct()
{
var_dump($foo);
}
}
$bar = new bar();
this results in a NULL value. Is it possible to reach $foo inside the class bar? with some fancy magic word in php?
...
hellHi Folks,
I have a contact form on my webpage, and it workd fine so far.
Only problem is, that in my mailprogram, the name in the from field doesn't show correctly, although the sourcecode of the email seems correct:
From: Metaldemos <[email protected]>
Reply-To: Metaldemos <[email protected]>
Anyway, in the mailprogram, t...
Hi guys,
Here is my anchor tag, onclick of which i am going to call function which creates dataline chart:
echo "<a id = \"#dhf\" class = \"graph_dhf\" href = \"javacript void(0)\" onclick=\"open_page('senddata($unm)', 'my_chart1');\">datalinechart</a>";
here
open_page('url', target) function in ajax_navigation.js page which i set...
Hi, I'm trying to unzip a 14MB archive with PHP with code like this:
$zip = zip_open("c:\kosmas.zip");
while ($zip_entry = zip_read($zip)) {
$fp = fopen("c:/unzip/import.xml", "w");
if (zip_entry_open($zip, $zip_entry, "r")) {
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
fwrite($fp,"$buf")...
i want to use this php-language-api
i think it is great but with text only
it can not wrok with html text
see
$text = htmlspecialchars('<a href="test.php">test.php</a>');
$str = Google_Translate_API::translate($text, 'en', 'ar');
or
$text = '<a href="test.php">test.php</a>';
$str = Google_Translate_API::translate($text, 'en', 'ar');
...
This is intended to be more of a discussion than an outright question, hence I've made it community wiki.
When do you choose to break a method into smaller methods.
Say I have a method that has one purpose, i.e. to load a configuration file
public function configure($file){
$info = path_info(file);
$ext = $info['extension'];
...
Hi everyone, I need to back up a big database everydays.
Should I code it myself in PHP or is there a good script out there ?
...
I have an html page that I want to edit. I want to remove a certain section like the following:
<ul class="agentDetail">
........
.......
........
</ul>
I want to be able to remove the tags and all the content between them. The idea is to edit a page and redisplay it minus some data that I don't want to be seen (hence the removal of s...
http://nomilead.com/create.php?uid=abc&key=c79a&web_url=http://dinesh707.blogspot.com/
Here im trying to send the url as a parameted "web_url". The shown is an ajax request that sends to a php server back end.
from php end im trying to capture this by
$web_url = $_GET["web_url"];
but it does not work.
Please help me out ...
I think I'm doing this wrong but this is what I have...
if($_GET['color']) {
$color = "signature_";
echo "<img src=\"/images/+ $color \"; \"class=\"border\" alt=\"\" />";
What I'm trying to do is output the colored image based on the users input.
So say this is what I am doing.
Http://somedomain.com/index.php?username=Ultima&...
hi for example this is a plain text paragraph:-
Domain Name: COMCAST.NET
Registrar: CSC CORPORATE DOMAINS, INC.
Whois Server: whois.corporatedomains.com
Referral URL: http://www.cscglobal.com
Name Server: DNS101.COMCAST.NET
Name Server: DNS102.COMCAST.NET
Name Server: DNS103.COMCAST.NET
Name Server: DNS104.COMCAST.NET
Name Server: DNS10...
I have a python script that takes a number of variables. I also have a html page that can receive post values.
How can I start a browser from python and point it to the html page I have above and send those post variables to the html url?
The problem I have is that if I use urllib/urllib2 to do the post, it doesn't load the browser win...
ok im makeing a simple database for my example, there is users data and the user company's data .
CREATE TABLE `users` (
`UID` INT(25) NOT NULL AUTO_INCREMENT ,
`username` VARCHAR(60) NOT NULL ,
`password` VARCHAR(100) NOT NULL ,
`ownername` VARCHAR(150) NOT NULL ,
`userstatus` TINYINT(1) NOT NULL ,
`userregistertime` DATETI...
Hi guys.
I have the following code to login into an external site application (asp.net app) from a local site login form (written in php):
<?php
$curl_connection = curl_init('www.external.com/login.aspx');
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT,
"Mozilla/4.0 (compatib...
Possible Duplicate:
how to import the all products of another site into magento site
i have created two website in magento according my client requirement.now i want to import all the product which are running in another website.in to my created website in magento how can i do it.please some body provide me solution.help will ...
Is it poosible to upload 100 MB file using PHP? If so, what are the changes are need to be done in the configuration file?
Sri
...
Hi, in the backend a user can select a country via dropdown menu, e.g. "Germany". The frontend is bilingual so i have to dump "Germany" if language A is set and "Deutschland" if language B is set.
How can i save the selection and its translation to separate fields in the database?
Thank you for any help!
...
Hi All,
I am using symfony1.1. In my app I am required to upload some image files through admin and store their content as blob in DB.
Here's how I am doing it,
1. Getting the fopen handle on the uploaded file.
2. Pass this to stream_get_contents($handle);
3. Store the content in as blob.
Everything works fine on WinXP, but on live se...
Hi,
I have XHTML that has empty (blank) lines:
some_tag
empty line
empty line
empty line
some_tag
I wonder how to get rid of them using PHP str_replace. The result should be some_tag some_tag. What are these blank lines anyways?
...