|
This is not including. in php including is far different thing you are trying to do. all you need to use is html tag iframe and in the src attribute use the address.
|
|
|
|
|
i would love to... but iframe doest support 100% height and 200% width.
so how can i fix it in iframe?
|
|
|
|
|
Hi,
can anyone help please.
I am getting this error:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/jassimrahma/JassimRahma.com/admin/get_login.php on line 10
Warning: Cannot modify header information - headers already sent by (output started at /home/jassimrahma/JassimRahma.com/admin/get_login.php:10) in /home/jassimrahma/JassimRahma.com/admin/get_login.php on line 20
here is my code:
<?php
session_start();
$username = $_POST['username'];
$password = $_POST['password'];
$dbC = mysql_connect('mysql.jassimrahma.com', 'jassimdb', 'mujtaba');
$sql = "SELECT * FROM website_admin WHERE website_admin_user_name = '$username' and website_admin_password = '$password'";
$result = mysql_query($sql, $dbC);
$count = mysql_num_rows($result);
if($count == 1)
{
$_SESSION['status'] = 'logged';
header("location:index.php");
}
else
{
header("location:login.php");
}
?>
|
|
|
|
|
The first warning is telling you that the value returned from mysql_query() , which you stored in $result is a boolean. This means that the query failed, because mysql_query returns FALSE when a SELECT query fails.
The second warning is telling you that it cannot output any headers, because it has already sent output to the browser - in this case, the first warning message.
You should check the return values from your database function calls. mysql_connect might have failed, or mysql_query could have failed for any number of reasons - use mysql_error[^] to find out what went wrong and fix it.
You should also sanitize all user input before building a query from it. Google for "sql injection" if you don't know what I'm talking about.
|
|
|
|
|
I got it... no database selected..
BUT...
now I have another problem..
everytime I enter the correct user id and password it's just going back to login.php with no error message.
I am 1000000% sure about the user id and password, infact I added another uder and having the same problem.
user ID : abc123
Password : abc123
|
|
|
|
|
Okay... I won't try to guess which page is doing what wrong, but I will give you this handy code snippet:
echo '<pre>' . print_r(get_defined_vars(), true) . '</pre>';
If you insert that into a page where you think things are going wrong, it will dump all the variables into the page. I would try putting it before your if statement that does the redirects first, and see if $count is what you expect it to be.
You should turn on all errors and warnings when you are developing too:
ini_set('display_errors', 1);
error_reporting(E_ALL | E_STRICT);
|
|
|
|
|
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?
|
|
|
|