| Author |
php help |
tuchezviper
Member
Posts: 17
Location:
Joined: 10.06.08 Rank: Moderate |
|
i am setting up a server and i am using a book called "learning php and mysql". according to the book i can use the following string to check if my server works but for some reason my browser cannot find it so maybe there is something wrong with the string or the way I am typing it:
<?php phpinfo ( ) ; ?>
 |
|
| Author |
RE: php help |
Futility
Member

Posts: 715
Location: USA
Joined: 17.12.07 Rank: God |
|
Your browser cannot find it? What are you saving the file as? Do you have PHP installed on your computer? How are you viewing the files? Are you uploading to a free host service, or just double clicking an icon somewhere? Knowing what you're doing makes it easier to help.
|
|
| Author |
RE: php help |
tuchezviper
Member
Posts: 17
Location:
Joined: 10.06.08 Rank: Moderate |
|
i installed php and the string is supposed to check if the php/apache installation was successful. I am trying to setup my own server. i am saving the file as .php
 |
|
| Author |
RE: php help |
Futility
Member

Posts: 715
Location: USA
Joined: 17.12.07 Rank: God |
|
It doesn't exactly check to make sure everything is set up fine. It "Outputs a large amount of information about the current state of PHP." Version, where it's loaded, HTTP header info... it's not a yes/no thing.
Anyway, how are you trying to open it? I'm not a PHP master by any means, but I have XAMPP installed and my PHP files will only work if I access them through http://localhost/. Double clicking their icons on the desktop doesn't help.
And what do you mean 'doesnt find it'. Are you getting a blank page, error, what?
|
|
| Author |
RE: php help |
tuchezviper
Member
Posts: 17
Location:
Joined: 10.06.08 Rank: Moderate |
|
it says it cannot find the page
when i try to restart the server it says it cannot determine the server's fully qualified domain name. What does that mean?

Edited by tuchezviper on 05-01-09 22:31 |
|
| Author |
RE: php help |
slpctrl
Member
Posts: 945
Location: 2147483647
Joined: 19.04.07 Rank: God |
|
|
<?phpinfo();?> |
|
| Author |
RE: php help |
spyware
Member

Posts: 4190
Location: The Netherlands
Joined: 14.04.07 Rank: God Warn Level: 90
|
|
|
slpctrl wrote:
<?phpinfo();?>
Cannot find file. The problem occurs before the code parsing.
@OP, are you sure about the filename? If you're coding in notepad you might have saved the file as filename.php.txt, because notepad auto-adds .txt if you don't change that setting while saving a file.
Also, make sure Apache is running (on the right port).

"The chowner of property." - Zeph Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term. - Carl Sagan Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor? - Ebert |
|
| Author |
RE: php help |
Zephyr_Pure
Member

Posts: 2402
Location:
Joined: 15.09.06 Rank: God |
|
Put the php file containing the <? phpinfo(); ?> in C:\Apache2\htdocs\, then navigate to http://localhost/whatever-you-named-the-file.php. If it doesn't work, restart Apache (Start, Run, services.msc, Apache2, Restart), then try again. List any issues you have.
I still check PMs from time to time.


Our responses were moronic, why shouldn't he follow suit? - Futility |
|
| Author |
RE: php help |
adlez
Member

Posts: 84
Location: amerika
Joined: 27.07.06 Rank: Hacker Level 1 |
|
give us screen shots
Knowledge is Freedom.
Plain is Simple. Simple is Complex.
|
|
| Author |
RE: php help |
AldarHawk
The Manager

Posts: 1663
Location: Canada
Joined: 26.01.06 Rank: God |
|
Screenshots work well and all but I think you need a more personal touch. Message me on MSN or PM me here or on any of my websites.
I will give you a hand with your issue. I think I know your problem.
|
|
| Author |
RE: php help |
god_peet
Member

Posts: 69
Location: Code
Joined: 28.11.07 Rank: God |
|
If you like the easy way, you can install xampp.
If not, this will help you, I think.
http://blog.taragana.com/index.php/archive/how-to-configure-php-5-with-apache-2-on-windows-in-2-minutes/
|
|
| Author |
RE: php help |
erm4c
Member

Posts: 15
Location: 01101001 01100110
Joined: 19.03.09 Rank: Hacker Level 1 |
|
Don't wanna make a new topic so I'll put this here.
First of all, I'm still studying / learning PHP so I gotta say I don't know much about it. That's why I need some help.
I'm doing some basic websites for a couple of friends and one of them wanted a contact form. So first I did it with mailto -command, but 'cause it always popped up Outlook I started to look different ways to make the form. After googlin around I found this simple copy-paste php-form for contact. It has two php-pages that look like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Email Form </title>
<body>
<form method="post" action="sendeail.php">
<!-- DO NOT change ANY of the php sections -->
<input type="hidden" name="ip" value="88.113.97.167" />
<input type="hidden" name="httpref" value="" />
<input type="hidden" name="httpagent" value="Mozilla/5.0 (X11; U; Linux i686; fi-FI; rv:1.9.0.8) Gecko/2009032711 Ubuntu/8.10 (intrepid) Firefox/3.0.8" />
Your Name: <br />
<input type="text" name="visitor" size="35" />
<br />
Your Email:<br />
<input type="text" name="visitormail" size="35" />
<br /> <br />
<br />
Attention:<br />
<select name="attn" size="1">
<option value=" Sales n Billing ">Sales n Billing </option>
<option value=" General Support ">General Support </option>
<option value=" Technical Support ">Technical Support </option>
<option value=" Webmaster ">Webmaster </option>
</select>
<br /><br />
Mail Message:
<br />
<textarea name="notes" rows="4" cols="40"></textarea>
<br />
<input type="submit" value="Send Mail" />
<br />
Free Code at: <a href="http://www.ibdhost.com/contact/">ibdhost.com/contact/</a>
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail scblockedript</title>
</head>
<body>
<!-- Reminder: Add the link for the 'next page' (at the bottom) -->
<!-- Reminder: Change 'YourEmail' to Your real email -->
<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitormail = $_POST['visitormail'];
$notes = $_POST['notes'];
$attn = $_POST['attn'];
if (eregi('http:', $notes)) {
die ("Do NOT try that! ! ");
}
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
die ("Go back! ! ");
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
die ("Use back! ! ");
}
$todayis = date("l, F j, Y, g:i a") ;
$attn = $attn ;
$subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";
$from = "From: $visitormail\r\n";
mail("yourmail@mail.com", $subject, $message, $from);
?>
<p align="center">
Date: <?php echo $todayis ?>
<br />
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br />
Attention: <?php echo $attn ?>
<br />
Message:<br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
<?php echo $ip ?>
<br /><br />
<a href="contact.php"> Next Page </a>
</p>
</body>
</html>
The problem is that in the contact.php (that is the upper one of the two) has only three fields (name, mail & text-area) for a visitor to fill in, but I need four (name, mail and two text-areas). I tried adding another text-area and I can see it when I look it with the browser. When I fill-in all the boxes and make it send a mail to me, I don't recieve any information from the second text-area (the one that I added later on). I do get info from the original boxes (name, mail and text-area) but nothing from the one I added. What do I have to do / how do I change the code to make another text-area and make it include that info to the mail?
The World is an Open Source!
Edited by erm4c on 06-04-09 18:06 |
|
| Author |
RE: php help |
GTADarkDude
Member

Posts: 142
Location: The Netherlands
Joined: 23.02.08 Rank: God |
|
Well, of course it doesn't show up in the e-mail if you don't include it in the $message variable. I'd advise you to learn PHP before you start downloading arbitrary scblockedripts on the internet. Do you actually know what each line in the scblockedript does?
Edit: My apologies, a quick glance was not enough to see what you were doing. I did not look trough the scblockedript thoroughly enough and missed a couple things. Again, my apologies.
...
Edited by GTADarkDude on 06-04-09 20:03 |
|
| Author |
RE: php help |
harry_potter28
Member
Posts: 167
Location:
Joined: 11.09.08 Rank: HBH Guru |
|
Just make another text area as the previous one with a different name and then catch it in the second page using : "$_POST"
How to use $_POST is there in the second page code that you posted.
Then use that value in your mail. |
|
| Author |
RE: php help |
harry_potter28
Member
Posts: 167
Location:
Joined: 11.09.08 Rank: HBH Guru |
|
|
GTADarkDude wrote:
Well, of course it doesn't show up in the e-mail if you don't include it in the $message variable. I'd advise you to learn PHP before you start downloading arbitrary scblockedripts on the internet. Do you actually know what each line in the scblockedript does?
I would also like suggest you to go and read the PHP because the thing you are asking is there, just you should know what each line is doing and edit it to your use. |
|
| Author |
RE: php help |
ynori7
Future Emperor of Earth

Posts: 1481
Location: #valhalla
Joined: 08.10.07 Rank: Diabolical |
|
|
<form method="post" action="sendeail.php">
I think there's a typo in your filename, but that wouldn't be the problem.
It is in fact getting the data from all the inputs. Make use of echo's to debug and find where your problem is.
echo $ip."<BR>".$httpref."<BR>".$httpagent."<BR>".$visitor."<BR>".$visitormail."<BR>".$notes."<BR>".$attn;
Put that line right after you pull in all the $_POST data and you'll see that all the data is there.
Edited by ynori7 on 06-04-09 18:38 |
|
| Author |
RE: php help |
slpctrl
Member
Posts: 945
Location: 2147483647
Joined: 19.04.07 Rank: God |
|
ynori7 wrote:
<form method="post" action="sendeail.php">
I think there's a typo in your filename, but that wouldn't be the problem.
It is in fact getting the data from all the inputs. Make use of echo's to debug and find where your problem is.
echo $ip."<BR>".$httpref."<BR>".$httpagent."<BR>".$visitor."<BR>".$visitormail."<BR>".$notes."<BR>".$attn;
Put that line right after you pull in all the $_POST data and you'll see that all the data is there.
Might seem very minor, but it'd probably be easier to wrap the whole echo statement in double quotes. Variables are still parsed in double quotes :p, and you won't have to use ."".
echo "$ip<BR>$httpref<BR>$httpagent<BR>$visitor<BR>$visitormail<BR>$notes<BR>$attn";
|
|
| Author |
RE: php help |
erm4c
Member

Posts: 15
Location: 01101001 01100110
Joined: 19.03.09 Rank: Hacker Level 1 |
|
|
GTADarkDude wrote:Do you actually know what each line in the scblockedript does?
All? No I don't. That's why (like I said before) I'm reading about PHP to learn about it. And that's also the reason I looked up this free php-form.
Thanks for the help everybody.
The World is an Open Source! |
|
| Author |
RE: php help |
slpctrl
Member
Posts: 945
Location: 2147483647
Joined: 19.04.07 Rank: God |
|
erm4c wrote:
GTADarkDude wrote:Do you actually know what each line in the scblockedript does?
All? No I don't. That's why (like I said before) I'm reading about PHP to learn about it. And that's also the reason I looked up this free php-form.
Thanks for the help everybody.
If you need any help, drop me a PM. A mail scblockedript is extraordinarily easy. I could walk you through the steps and show you how to make a better, more secure mail form. |
|
| Author |
RE: php help |
erm4c
Member

Posts: 15
Location: 01101001 01100110
Joined: 19.03.09 Rank: Hacker Level 1 |
|
|
slpctrl wrote:
If you need any help, drop me a PM. A mail scblockedript is extraordinarily easy. I could walk you through the steps and show you how to make a better, more secure mail form.
Your inbox is full dude.
But anyway.. Right now I'm doing it with the scblockedript that I posted on the forum on my friends "test-page". This because I let him test it first and see if he really likes and needs it. IF he then decides that we'll put it in to the actual site in action I'll hit up with PM and ask for that tutorial. 
The World is an Open Source!
Edited by erm4c on 06-04-09 20:23 |
|