|
Hi,
can anyone help on how to do this in htaccess please..
I want to make every:
www.mydomain.com/news.php?id=777
shows as
www.mydomain.com/777
where 777 is the primary key in my news table.
Thanks,
Jassim
|
|
|
|
|
I been looking around for a good tool to learn PHP and i stumble up on this http://be2f81j9hp809o6rpk2bhbxkd5.hop.clickbank.net/?tid=1 site. Please tell me what you think about it?
|
|
|
|
|
Hi Friends,
I am new to PHP and I want to know how to run a PHP program .Would like to know how to configure it and kindly help in suggesting what kind of software to be used to run it.I tried with WAMP Server but i was not able to run it. .Thanks in Advance.
|
|
|
|
|
Upon successful installation of WAMP, open a text editor and type
<html>
<head><title>My First PHP Website</title></head>
<body>
<?php phpinfo(); ?>
</body>
</html>
make sure that you save it in the www of your php installation folder: eg: C:\wamp\www
then laugth your web browser and typing http://localhost/filename.php or http://localhost:8080/filename.php as the case may be.
it should work this way.
welcome to the php world
happy programming
|
|
|
|
|
Thanks friend.I installed the wamp server and placed the following code in www folder .And started the server in the web browser typed the url http://localhost/filename.php[]
But i m getting this error message.
Not Found
The requested URL /filename.php was not found on this server.
Apache/1.3.12 Server at changeme.local.lan Port 80
I really want to learn php .Kindly help me
|
|
|
|
|
the file name I mean is the name you gave the file when you saved it. eg: index.php (the file name is index).
|
|
|
|
|
I saved with the same filename .Got to know the problem now but dont have the solution for the same.
The issue is that port 80 is being used by another process hence apachi is not installed i guess in wamp server .I dont know how to configure it to another port no .
|
|
|
|
|
You can verify if Apache was installed from windows services (scroll down and look for wampapache). If not, you can uninstall the wamp server and reinstall again, then ensure that WAMP installs Apache for you.
Hope this helps?
|
|
|
|
|
Even if port 80 is in use that should not stop the installation of WAMP. You won't be able to startup WAMP until you close the other program using port 80. Usually this is skype, as this reserves port 80 and 8080 for outgoing and incoming traffic.
You can try and locate the process by running
netstat -ob .
|
|
|
|
|
Thanks for all .Successfully executed my first php program. .I formatted my system and installed it and i m able to run the program now .
|
|
|
|
|
Hi,
I am a newbie, I want to install a Perl script named "Movable Type", I am unable to configure it myself, so I was searching for a software that could provide me to install this script very easily and I came across AMPPS, a Softaculous product. Had anyone use this software, if yes then how is this software and how can I install this script using AMPPS ?
|
|
|
|
|
Do you really need an installer for a script? The whole point of scripting is supposed to be the simplicity of it. If you really need an installer, then maybe scripting isn't for you.
What are you using the script for? Is it just an extension for Perl?
|
|
|
|
|
To be fair cpan is specifically used for installing modules in perl.
Certainly I haven't installed any perl modules or perl itself for many years without using some sort of installer.
|
|
|
|
|
You certainly can't compare the installation of perl with running a script in perl. Perl itself is a complex arrangement of packages and an interpreter... a script can be a simple two line text file. If you need to run a script that requires an installer, you probably should be doing it as a program instead of a script.
|
|
|
|
|
Paul1586 wrote: I am a newbie, I want to install a Perl script named "Movable Type", I am unable to configure it myself
What does that mean exactly.
If you install something and it requests/requires information from the user during install then the user needs to figure out what that info means.
If you were installing in multiple locations on fixed platform targets (all the same) then you could simplify the install by putting in appropriate values. However YOU would need to first figure out what the correct values were.
|
|
|
|
|
Movable Type isn't just a single perl script. It is a multi-user blogging system (I thought it reminded me of a site I'd used when I set it up and that is indeed what plinky.com is using - no plug intended)
Setting it up under windoze was relatively easy. Copy the mt directory to somewhere under the web server's document root, modify the httpd.conf, add a perl module or too as required by the config cgi (it tells you what's missing), and fix the #! lines in the cgi's for windoze. Setting up a new user via the register link requires that outgoing mail is working properly. Had to search in the online documentation for the config file settings it needs for SMTP.
Took me a grand total of 45 minutes, never having installed/configured MT before. I did take the easy route and used SQLite instead of trying Mysql or Postgresql (both are currently on my windoze box though)
Installation under linux would be easier, no editing all those cgi's by hand (not really enough for a script for a single time install but the creators could have included one...)
|
|
|
|
|
Hi all,
I am new to PHP development after a reasonable experience with the .NET.
I have just created a class to return list of categories from the category table and display on my home page.
Below is my code snippets:
<?php
class Connection {
private $username = "root";
private $password = "password";
private $dbName = "aweklin";
private $host = "localhost";
private $link;
public function __construct() {
$this->link = mysqli_connect($this->host, $this->username, $this->password);
if (!$this->link) {
}
if (!mysqli_set_charset($this->link, 'utf8')) {
}
if (!mysqli_select_db($this->link, $this->dbName)) {
}
}
public function getAllCategories() {
$sql = mysqli_query($this->link, "CALL getCategories()");
while ($row = mysqli_fetch_array($sql)){
$row['description'] . '<br />';
}
return $row;
}
public function executeQuery ($query) {
if (!$this->query($query)) {
}
}
}
?>
on my home.php page, I have:
<?php include_once $_SERVER['DOCUMENT_ROOT'] . 'aweklin/classes/LinkHelper.php'; ?>
<?php include_once $_SERVER['DOCUMENT_ROOT'] . 'aweklin/classes/DB/Connection.php'; ?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="styles/layout.css" type="text/css" />
<script type="text/javascript" src="script/ref/jquery-1.6.2.min.js" /></script>
<title><?php StringHelper::getHtml($title, TRUE); ?></title>
</head>
<body>
<div id="wraper">
<?php
LinkHelper::setPageHeader();
?>
<div id="page">
<article>
<div class="content">
<div class="title"><?php StringHelper::getHtml($title, TRUE); ?></div>
<?php
$con = new Connection();
$cat[] = $con->getAllCategories();
foreach ($cat as $c) {
echo $c;
}
?>
</div>
</article>
<?php
LinkHelper::setSideBar();
?>
</div>
<?php
LinkHelper::setPageFooter();
?>
</div>
</body>
</html>
The problem is, I got nothing displayed on the home.php page.
If you can notice, I comment out some block of code their, that worked for me. But I want to use OOP approach to do this.
Tell me, what am I getting wrong here?
Thanks.
|
|
|
|
|
Your getAllCategories function will return NULL, because it is returning the last value returned by mysqli_fetch_array($sql) .
You can return an array of results this way:
$results = array();
while($row = mysqli_fetch_array($sql)){
$results[] = $row['description'];
}
return $results;
or a string:
$results = '';
while($row = mysqli_fetch_array($sql)){
$results .= $row['description'] . '<br />';
}
return $results;
You also have $cat[] = $con->getAllCategories(); - this will add whatever the function returns as a new entry in the $cat array, which probably is not what you want.
|
|
|
|
|
Thank Graham;
Your response was correct. So on my home.php page, this is what I finaly did:
$con = new Connection();
$cat = $con->getAllCategories();
foreach ($cat as $c) {
echo $c['description'] . '<br />';
}
But the result of the above was the first character of each record per row.
How do I fix this?
|
|
|
|
|
This is a bit confusing, but I've worked it out.
You've already pulled the "description" field out of the row in the getAllCategories function - so now echo $c['description'] ... is accessing the string $c , and not an associative array. The square brackets are referring to the characters of the string, so 'description' is being evaluated as 0 and you are getting the first character in the string.
Try using this instead:
echo $c . '<br />';
|
|
|
|
|
Thanks.
I am very glad for your response.
Now, I am getting it right. Please don't be annoyed.
Thanks once again.
|
|
|
|
|
Hi guys
I'm using fedora core 6, php5 and apache2, i downloaded gd2 compiled and test with gddemo and its working fine...
php is located: /usr/local/php
gd is located: /usr/local/gd
how should i make it working with php, i have tried to recompile php with the following command
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --enable-track-vars --with-gd=/usr/local/gd
last time i compiled php with the following command:
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql
but still when i see through phpinfo();
i'm getting
Configure Command './configure' '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql=/usr/local/mysql'
I have put the line in php.ini
extension=gd.so
and
also un-commented the line
extension=php_gd2.dll
but in vain
|
|
|
|
|
Hi all,
Hope this it the right forum to post my section.
I want to create a WP site with multiple languages. So I search the wed for any solution, and found WPML plug-in. However it is not a free solutions. So did any of you guys have use any others. If so please share it with me.
Thanks in advance.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
I had to develop multi-language site, mainly English and Japanese.
I use a separate language file for each language and entire content is made by php. But I am not sure if its the best solution. here is an example :
lang_japanese.php
<?php
$pageName=array(
'UserName'=>"ユーザーネーム",
'Password'=>"パスワード"
);
?>
lang_english.php
<?php
$pageName=array(
'UserName'="User Name",
'Password'='Password'
);
?>
<?php
if(isset($_SESSION['Language'])==true)
$lang=$_SESSION['Language'];
else $lang='english';
require_once("lang_".$lang.".php");
?>
<?=$pageName['UserName']?><input type='text' name='UserName' value=''>
<?=$pageName['Password']?><input type='password' name='password' value=''>
By the way , I do not use any framework or CMS
|
|
|
|
|
Much similar technique I've used previously. But it is bit of work with the WP. Some kind of plugin will make life easy. However I've found list of plugins and want to try them out, and will share with you.
Thanks for the comment too.
I appreciate your help all the time...
CodingLover
|
|
|
|