|
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
|
|
|
|
|
Did you look at Drupal as an alternative to Wordpress? It's very strong on internationalisation. [having just typed that, I can see why it's called i18n! ]
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
I would appreciate if you share
|
|
|
|
|
Hi everyone,
I have problem with form at my site. When you fill the text boxes it works fine but when you click SEND, the site is refreshing, form is clear and no message has been sent. My knowledge about PHP is very low. I found the tutorial which shows how to make that kind of form.
form is on this site --> www.hogar-biokominki.pl/jak_kupic.html
I have 3 files which operate the form.
first file: formularz.php
<div class="form" >
<form action="jak_kupic.php" method="post" id="form1">
<input type="hidden" name="sender" value="true">
Formularz kontaktowy
<label for="imieinazwisko">Imię i Nazwisko:</label>
<input name="imieinazwisko" type="text" id="imieinazwisko" tabindex="1" maxlength="30">
Pole wymaganeZa mało znaków
<label for="adresemail2">Adres e-mail:</label>
<input type="text" name="adresemail" id="adresemail2" tabindex="2">
Błędny adres emailBłędny adres e-mail
<label for="walidacjaemail">Podaj ponownie e-mail:</label>
<input type="text" name="walidacjaemail" id="walidacjaemail" tabindex="3">
Pole wymaganeAdres się nie zgadza
<label for="numertelefonu">Telefon:</label>
<input type="text" name="numertelefonu" id="numertelefonu" tabindex="4">
Niewłaściwy numerNiewłaściwy numerZa mało cyfr
<label for="miasto">Miasto:</label>
<input name="miasto" type="text" id="miasto" tabindex="5" maxlength="15">
<label for="wiadomosc2">Wiadomość:</label>
<textarea name="wiadomosc" id="wiadomosc2" cols="45" rows="5" tabindex="6"></textarea>
Pole wymaganeZa mało znaków
<input type="submit" name="wyslij" id="wyslij" value="Wyślij" tabindex="6">
</form>>
second file: jak_kupic.html (I paste only form's DIV)
<div class="form">
<form action="" method="post" name="form1" id="form1">
<fieldset>
<legend>Formularz kontaktowy</legend>
<li><span id="sprytextfield1">
<label for="imieinazwisko">Imię i Nazwisko:</label>
<input name="imieinazwisko" type="text" id="imieinazwisko" tabindex="1" maxlength="30">
<span class="textfieldRequiredMsg">Pole wymagane</span><span class="textfieldMinCharsMsg">Za mało znaków</span></span></li>
<li><span id="sprytextfield2">
<label for="adresemail2">Adres e-mail:</label>
<input type="text" name="adresemail" id="adresemail2" tabindex="2">
<span class="textfieldRequiredMsg">Błędny adres email</span><span class="textfieldInvalidFormatMsg">Błędny adres e-mail</span></span></li>
<li><span id="spryconfirm1">
<label for="walidacjaemail">Podaj ponownie e-mail:</label>
<input type="text" name="walidacjaemail" id="walidacjaemail" tabindex="3">
<span class="confirmRequiredMsg">Pole wymagane</span><span class="confirmInvalidMsg">Adres się nie zgadza</span></span>
</li>
<li><span id="sprytextfield3">
<label for="numertelefonu">Telefon:</label>
<input type="text" name="numertelefonu" id="numertelefonu" tabindex="4">
<span class="textfieldInvalidFormatMsg">Niewłaściwy numer</span><span class="textfieldMinCharsMsg">Niewłaściwy numer</span><span class="textfieldMinValueMsg">Za mało cyfr</span></span></li>
<li>
<label for="miasto">Miasto:</label>
<input name="miasto" type="text" id="miasto" tabindex="5" maxlength="15">
</li>
<li>
<span id="sprytextarea1">
<label for="wiadomosc2">Wiadomość:</label>
<textarea name="wiadomosc" id="wiadomosc2" cols="45" rows="5" tabindex="6"></textarea>
<span class="textareaRequiredMsg">Pole wymagane</span><span class="textareaMinCharsMsg">Za mało znaków</span></span></li>
<li>
<input type="submit" name="wyslij" id="wyslij" value="Wyślij" tabindex="6">
</fieldset>
</form>
</li>
</ul>
</div>
third file: jak_kupic.php (pasted only form's DIV)
<div class="form_field">
<img src="images/jak_zamawiac_02.jpg" width="1024" height="661" alt="formularz">
<?
if(isset($_POST["sender"]))
{
$imie=$_POST['imieinazwisko'];
$email=$_POST['adresemail'];
$telefon=$_POST['telefon'];
$miasto=$_POST['miasto'];
$wiadomosc=$_POST['wiadomosc'];
$reply_subject= 'Zapytanie ze strony Hogar';
$reply_body = 'Witamy serdecznie,\nOtrzymaliśmy Państwa wiadomość. Odezwiemy się najprędzej jak to mozliwe.\n\nZ poważaniem\nBiokominki Hogar';
$reply_email = 'biuro@hogar-biokominki.pl';
$to = 'biuro@hogar-biokominki.pl';
$from = $imie . "<" . $email .">";
$subject = 'Zapytanie ze strony Hogar';
$body="\n\nImię i Nazwisko" . $imie . "\n\nEmail: " . $email . "\n\nTelefon" . $telefon . "\n\nMiasto" . $miasto . "\n\nWiadomość:" . $wiadomosc;
$coding = "Content-Type: text/plain; charse=utf-8 \nContent-Transfer-Encoding: 8bit";
if(mail($to, $subject, $body, "From: " . $from . "\n" . $coding))
{
if(mail($email, $reply_subject, $reply_body, "From: " . $reply_email . "\n" . $coding))
{
echo"<p class=\"dziekujemy\"> Dziekujemy za wysłanie wiadomości!</p>";
}
else
{
echo"<p class=\"dziekujemy\">Formularz nie został wysłany. Spróbuj ponownie.</p>";
}
}
}
require_once("formularz.php");
?>
</div>
Strange thing is that I can send form from /jak_kupic.php and it works. But layout sucks. But I can't send from /jak_kupic.html.
Can I connect these two files somehow?
|
|
|
|
|
You can post the form to the 'jak_kupic.html' but keep in mind that this is a static page, so it won't be able to handle your post data.
So you should post to a PHP page if you want the form to be processed server side. You PHP could then include the 'jak_kupic.html' when the form process is done and succesfull. You can do this by including the following line of code after the form processing:
|
|
|
|
|
I have pasted formularz.php to jak_kupic.php and it is not working too. I get some errors.
I have now jak_kupic.php looks like that:
<div class="form_field">
<img src="../Documents/WEBSITES/Hogar/www/images/jak_zamawiac_02.jpg" width="1024" height="661" alt="formularz">
<?
$imie=$_POST['imieinazwisko'];
$email=$_POST['adresemail'];
$telefon=$_POST['numertelefonu'];
$miasto=$_POST['miasto'];
$wiadomosc=$_POST['wiadomosc'];
$reply_subject= 'Zapytanie ze strony Hogar';
$reply_body = 'Dziekujemy za kontakt. Odezwiemy sie wkrotce.';
$reply_email = 'biuro@hogar-biokominki.pl';
$to = 'biuro@hogar-biokominki.pl';
$from = $imie . "<" . $email .">";
$subject = 'Zapytanie ze strony Hogar';
$body="\n\nImię i Nazwisko: " . $imie . "\n\nEmail: " . $email . "\n\nTelefon: " . $numertelefonu . "\n\nMiasto: " . $miasto . "\n\nWiadomość:" . $wiadomosc;
$coding = "Content-Type: text/plain; charse=utf-8 \nContent-Transfer-Encoding: 8bit";
if(mail($to, $subject, $body, "From: " . $from . "\n" . $coding))
{
if(mail($email, $reply_subject, $reply_body, "From: " . $reply_email . "\n" . $coding))
{
echo"<p class=\"dziekujemy\"> Dziękujemy za wysłanie wiadomości!</p>";
}
else
{
echo"<p class=\"dziekujemy\">Formularz nie został wysłany. Spróbuj ponownie.</p>";
}
}
if(isset($_POST['sender'])) { echo "style=\"display:none;\""; } ?>>
<form action="../Documents/WEBSITES/Hogar/www/jak_kupic.php" method="post" id="form1">
<input type="hidden" name="sender" value="true">
<fieldset>
<legend>Formularz kontaktowy</legend>
<li><span id="sprytextfield1">
<label for="imieinazwisko">Imię i Nazwisko:</label>
<input name="imieinazwisko" type="text" id="imieinazwisko" tabindex="1" maxlength="30">
Pole wymaganeZa mało znaków</span></li>
<li><span id="sprytextfield2">
<label for="adresemail2">Adres e-mail:</label>
<input type="text" name="adresemail" id="adresemail2" tabindex="2">
Błędny adres emailBłędny adres e-mail</span></li>
<li><span id="spryconfirm1">
<label for="walidacjaemail">Podaj ponownie e-mail:</label>
<input type="text" name="walidacjaemail" id="walidacjaemail" tabindex="3">
Pole wymaganeAdres się nie zgadza</span>
</li>
<li><span id="sprytextfield3">
<label for="numertelefonu">Telefon:</label>
<input type="text" name="numertelefonu" id="numertelefonu" tabindex="4">
Niewłaściwy numerNiewłaściwy numerZa mało cyfr</span></li>
<li>
<label for="miasto">Miasto:</label>
<input name="miasto" type="text" id="miasto" tabindex="5" maxlength="15">
</li>
<li>
<span id="sprytextarea1">
<label for="wiadomosc2">Wiadomość:</label>
<textarea name="wiadomosc" id="wiadomosc2" cols="45" rows="5" tabindex="6"></textarea>
Pole wymaganeZa mało znaków</span></li>
<li>
<input type="submit" name="wyslij" id="wyslij" value="Wyślij" tabindex="6">
</fieldset>
</form>
</li>
</ul>
</div>
|
|
|
|
|
hi ,
dont go to action of other page. end part of code (php code) include in top of the form code(inside a php tag) .
dont put echo in that php part redirect to this page get a value from url
Example:
<title>
.... Your form code .......
Redirect example :
header("Location:text.php?val=Successfull message");
Thank You....
|
|
|
|
|
Hi,
I am using this to as header for my email form submition send.php file:
$mailheader = "From: ".$_POST["email"]."\r\n";
but I also have
$_POST["email"]
coming from the contact.php form.
I want to know how can I send the email but make sure to show the name and in the From like this Jassim Rahma <jassim@email.com> so the name will be shown in the inbox of the recipient's email instead of the email address
Thanks,
Jassim
|
|
|
|
|
To show the name in the from field, use this format:
From: My Name <address@domain-name.com>
So in your PHP you should put something like this:
$mailheader = "From: " . $_POST['name'] . " <" . $_POST['email'] . ">\r\n";
|
|
|
|