PHP - Php Not Installed Correctly?
I just installed XAMP on my windws pc. When I try to launch my index.html file, I only get this output: Hello World";?>
This is not correct...
<html>
What is wrong? Similar Tutorialshi, I am trying to send an email with an attachment using PEAR, I have installed PEAR and in my email script I am including teh mail.php and mail_mime.php pages but now I get an error: Fatal error: Class 'Mail' not found in /home/fhlinux129/e/edisongray.com/user/htdocs/PEAR/Mail/mail.php on line 51 Line 51: Code: [Select] class Mail_mail extends Mail { Hello, I'm fairly new to PHP, and I'm trying to get the GD2 library working but I am having no luck. I have installed the library, and when I run phpinfo(); it shows that it is up and running, and all file types are supported. However, when I run the following code snippet nothing is displayed: <?php $im = @imagecreate (200, 100) or die ( "cannot create a new gd image."); $background_color = imagecolorallocate ($im, 240, 240, 240); $border_color = imagecolorallocate ($im, 50, 50, 50); $text_color = imagecolorallocate ($im, 233, 14, 91); imagerectangle($im,0,0,199,99,$border_color); imagestring ($im, 5, 10, 40, "a simple text string", $text_color ); header ("content-type: image/png"); imagepng ($im); ?> I have been struggling with this for a couple of weeks now with no luck. Any help would be greatly appreciated. How do I check in PHP if something like the GD library is installed on a server? I am going to be making a thumbnailing system and the user can install the app on their server. If they have the GD library, continue with making thumbnails, else show a default thumbnail. This topic has been moved to Other Web Server Software. http://www.phpfreaks.com/forums/index.php?topic=346533.0 How can i check whether php is installed or not on windows? I didn't installed wamp or xamp. But i have installed Zend Apache. And i can do http://localhost/ from browser. Hi, I'm working on a project which was going pretty well until I discovered the application doesn't actually know where it is installed. So far when I want to include the config file I just use $_SERVER['DOCUMENT_ROOT'].'/config.php';() Which works fine if the application is installed in the root directory. But how do I get the folder the application is installed in? e.g. Document Root Folder: C:\Web\ Actually Application Folder: C:\Web\MyApp\ How do I get the \MyApp dynamically? I can't just use './' all the time because I have files accessed by AJAX stored in other folders. Thanks in advance. This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=346325.0 Hi, I recently attempted to install a refer-a-friend script into my website but I really don't use PHP at all and even my html is very sloppy so it didn't get installed as planned. It currently cuts out the bottom half of my website like so: http://www.returntherake.com/refer.php Basically everything before the script is called is fine but everything after doesn't work. Heres the code from the point its installed till the end of my website. Any help would be great. Thank you so much. Quote <script language="php"> // Number of friend feilds to put on the page $tellnumber = "3"; // Subject of email $subject = "Great Poker Rakeback Site"; // Message sent in the email $message = "Look at this great site I found. I think you'll like it. It will boost your profits while playing online poker by getting you some of your rake back. http://www.ReturnTheRake.com/ When signing up with a website remember to say $_POST[name] referred you in the proper section. As you will recieve a 25% bonus on your first $20 rakeback recieved."; // Url to redirect user to once they click submit $thankyouurl = "http://www.returntherake.com/thankyou_refer.html"; ////////////////////////////////////////////////////////////////////////////////// // DO NOT EDIT ANYTHING BELOW THIS LINE // ////////////////////////////////////////////////////////////////////////////////// if($_POST[submitform] == "Submit") { $error = ""; $num=0; while($num < $tellnumber) { $num++; $temail = "femail"."$num"; $tname = "fname"."$num"; if($_POST[$tname] OR $_POST[$temail]) { if(!$_POST[$tname]) { $error .= "Missing Friends Name, Friend $num<BR>"; } if(!$_POST[$temail]) { $error .= "Missing Friends Email, Friend $num<BR>"; } } if($_POST[$temail]) { if(!ereg("@",$_POST[$temail])) { $error .= "Invalid Email Address, Friend $num<BR>"; } if(!ereg("\.",$_POST[$temail])) { $error .= "Invalid Email Address, Friend $num<BR>"; } } } if(!$_POST["name"]) { $error .= "Missing your name<BR>"; } if(!ereg("@",$_POST[email])) { $error .= "Invalid Email Address<BR>"; } if(!ereg("\.",$_POST[email])) { $error .= "Invalid Email Address<BR>"; } if($error) { ?> <BODY BGCOLOR="#ffffff"> <P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"> <TR> <TD WIDTH="100%" BGCOLOR="#01864E"> <TABLE WIDTH="340" BORDER="0" CELLSPACING="1" CELLPADDING="2"> <TR> <TD WIDTH="26%" BGCOLOR="#01864E"> <B><FONT COLOR="#ffffff" SIZE="-3" FACE="Verdana">Error</FONT></B></TD> </TR> <TR> <TD WIDTH="26%" BGCOLOR="#ffffff"> <FONT COLOR="#000000" SIZE="-3" FACE="Verdana"><? echo $error; ?></FONT></TD> </TR> </TABLE></TD> </TR> </TABLE></CENTER> <? exit(); } $extra ="\r\n"; $headers = ""; $headers .= "From: $_POST[name] <$_POST[email]>".$extra; $headers .= "Reply-To: $_POST[name] <$_POST[email]>".$extra; $headers .= "Return-Path: $_POST[name] <$_POST[email]>".$extra; $headers .= "Message-ID: <".time()." - $_POST[email]>".$extra; $headers .= "X-Mailer: PHP v".phpversion().$extra; $headers .= 'MIME-Version: 1.0'.$extra.$extra; $num=0; while($num < $tellnumber) { $num++; $temail = "femail".$num; $tname = "fname".$num; $print_f_name = $_POST[$tname]; $print_f_email = $_POST[$temail]; if($_POST[$temail] AND $_POST[$tname]) { mail($print_f_email,"$subject"," Hi, $print_f_name $message From $_POST[name] ",$headers); } } header("Location: $thankyouurl"); exit(); } else { $num=0; while($num < $tellnumber) { $num++; $theboxes .= " <TR> <TD WIDTH=\"49%\" BGCOLOR=\"#ffffff\"> <CENTER><B><FONT COLOR=\"#000000\" SIZE=\"-3\" FACE=\"Verdana\">$num</FONT></B></CENTER></TD> <TD WIDTH=\"26%\" BGCOLOR=\"#ffffff\"> <CENTER><INPUT NAME=\"fname$num\" TYPE=\"text\" SIZE=\"-3\"></CENTER></TD> <TD WIDTH=\"25%\" BGCOLOR=\"#ffffff\"> <INPUT NAME=\"femail$num\" TYPE=\"text\" SIZE=\"-3\"> </TD> </TR>"; } ?> <BODY BGCOLOR="#ffffff"> <P><CENTER><FONT FACE="Verdana"><B>Tell your friend about our site</B></FONT></CENTER></P> <FORM ACTION="tellfriend.php" METHOD="POST"><P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"> <TR> <TD WIDTH="100%" BGCOLOR="#01864E"> <TABLE WIDTH="340" BORDER="0" CELLSPACING="1" CELLPADDING="2"> <TR> <TD WIDTH="26%" BGCOLOR="#01864E"> <CENTER><B><FONT COLOR="#ffffff" SIZE="-3" FACE="Verdana">Your Poker Account</FONT></B></CENTER></TD> <TD WIDTH="25%"> <CENTER><B><FONT COLOR="#ffffff" SIZE="-3" FACE="Verdana">Your Email</FONT></B></CENTER></TD> </TR> <TR> <TD WIDTH="150" BGCOLOR="#ffffff"> <CENTER><INPUT NAME="name" TYPE="text" SIZE="12px"></CENTER></TD> <TD WIDTH="200" BGCOLOR="#ffffff"> <INPUT NAME="email" TYPE="text" SIZE="-3"> </TD> </TR> </TABLE></TD> </TR> </TABLE></CENTER></P><P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"> <TR> <TD WIDTH="100%" BGCOLOR="#01864E"> <TABLE WIDTH="340" BORDER="0" CELLSPACING="1" CELLPADDING="2"> <TR> <TD WIDTH="49%" BGCOLOR="#01864E"></TD> <TD WIDTH="26%" BGCOLOR="#01864E"> <CENTER><B><FONT COLOR="#ffffff" SIZE="-3" FACE="Verdana">Friends name</FONT></B></CENTER></TD> <TD WIDTH="25%"> <CENTER><B><FONT COLOR="#ffffff" SIZE="-3" FACE="Verdana">Friends email</FONT></B></CENTER></TD> </TR><? echo $theboxes; ?></TABLE></TD> </TR> </TABLE></CENTER></P> <P><CENTER><INPUT NAME="submitform" TYPE="submit" VALUE="Submit"></CENTER></FORM> <? exit(); } ?> </h3> </td> </tr> </table></td> <td width="1" bgcolor="#CCCCCC"></td> </tr> <tr> <td height="1" colspan="3" bgcolor="#CCCCCC"></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td height="10" align="center" valign="top"></td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td align="left" height="17" valign="top" class="style19"> </td> </tr> <tr> <td align="left" height="17" valign="top" class="style19"> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> <tr> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td align="left" valign="top" width="11"><img src="images/footer_bg_left.gif" alt="" height="120" width="11" /></td> <td class="footer" align="left" valign="middle"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td style="padding-left: 12px;" align="left" valign="top" width="260"><img src="images/footer_img.gif" alt="" height="110" width="249" /></td> <td align="left" valign="middle"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td class="footer_border" align="left" valign="top"> <a href="index.php">Homea> | <a href="#">Terms & Conditions</a> | <a href="#"> Privacy Policy</a> | <a href="#">Site Map</a> | <a href="#">Contact Us</a></td> </tr> <tr> <td class="footer_border" style="font-size: 10px; line-height: 22px;" align="left" valign="top">ReturnTheRake.com Copyright © 2010, All Rights Reserved.</td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> <td align="left" valign="top" width="11"><img src="images/footer_bg_right.gif" alt="" height="120" width="11" /></td> </tr> </tbody> </table> </td> </tr> <tr> <td align="left" valign="top"> </td> </tr> </tbody> </table> <br /> </body> </html> hello to all,
My issue is that i have a script encoded with zend and the script some pages work some are just BLANK
Zend it is installed :
This program makes use of the Zend Scripting Language Engine: Zend Engine v2.4.0, Copyright © 1998-2014 Zend Technologies with the ionCube PHP Loader v4.7.1, Copyright © 2002-2014, by ionCube Ltd., and with Zend Guard Loader v3.3, Copyright © 1998-2013, by Zend Technologies Configuration File (php.ini) Path /usr/local/lib Loaded Configuration File /usr/local/lib/php.ini and Its throwing exception he Can someone please help cuz i am tryin like a week to fix it but no results Edited by SSopranos, 07 January 2015 - 02:21 PM. i installed the most popular chat mod on smf forums called ajax chat. i am certain i did everything correctly. but when i try to test it i get a 403 on byethost. ive also had problems with phpbb this must mean that byethost must not allow ajax does anyone know of a server that will allow me to use this mod? hello dear php-freaks and -experts i just installed putty on linux - how to start it now? love to hear from you Edited by Maze, 27 November 2014 - 03:37 PM. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=350982.0 I want to use PEAR if it's installed and the regular "mail()" function if not. But to check for PEAR being installed, I can't check for the class PEAR existing because I have to include "Mail.php" first. The problem is that even though this statement works perfectly: Code: [Select] include_once "Mail.php"; This will ALWAYS be false: Code: [Select] if ( file_exists( "Mail.php" ) ) ... So how do I check for PEAR? If I just include the file, it throws a warning error that I can't seem to catch in a try..catch. I don't think php is installed/enabled?! This topic has been moved to Other Web Server Software. http://www.phpfreaks.com/forums/index.php?topic=347009.0 Is this the correct way to use http_post_fields? Code: [Select] $fields = array('title' => $_POST['title'], 'message' => $_POST['message']); $i = 0; while(1==1) { $i++; http_post_fields('http://www.rs2006.net/services/forums/board.ws?3,4,add', $fields); echo $i.' sent'; } I have a rule of conditions for access into an area of my site. The problem is, that when the wrong password is given, its still giving access to the area of the site. It is happening because I am using conditions wrong, and ask if someone could help me out by pointing out the correct way to do it. When I say "conditions", I am referring to things such as && and || if ($row['laybypassword'] == $_POST['lay-bypassword'] && $row['status'] == "A" || $row['status'] == "B" || $row['status'] == "C") So, if the correct password is given, and the row status equals A, B, or C, then do foobar. Hi, I have a class: Code: [Select] class Toplist { public function get_article($id) { $id = (int) $id; $articles = array(); $query = $db->sql_query("SELECT * FROM `toplist` WHERE `id` = '$id'"); $result = $db->sql_fetchrowset($query); return $articles; } } and I get Quote Notice: Undefined variable: db in classToplist.php on line 11 Fatal error: Call to a member function sql_query() on a non-object in classToplist.php on line 11 the variable db is in ./models/config.php and it isn't working on the classToplist. I have a feeling that this happens because the config file is not a class. How can I fix this? Hi, I think my problem is a mixture of MODREWRITE and PHP. I have the following .htaccess located in the web root. Code: [Select] RewriteEngine On RewriteRule ^about/(([^/]+/)*[^/.]+)$ /about/index.php?p=$1 [L] RewriteRule ^(([^/]+/)*[^/.]+)$ index.php?p=$1 [L] The index.php example below is located in the folder "about". Just for your info I also have an index at the web root too serving other files. <?php $page = isset($_GET['p']) ? $_GET['p'] : '/about/about'; switch($page) { /*----------------------- PAGES -----------------------------------*/ case 'about/profiles': $title = 'My Title'; $keyword = 'A few keywords'; $description = 'A good description.'; break; default: $title = 'My Title'; $keyword = 'A few keywords'; $description = 'A good description.'; break; } include($_SERVER['DOCUMENT_ROOT']. '/include/header.php'); include($_SERVER['DOCUMENT_ROOT']. 'about/'.$page.'.php'); include($_SERVER['DOCUMENT_ROOT']. "/include/footer.php"); ?> This is my problem: When I click on the link http://mysite.co.uk/about/ it throws the errors out below. When I click on the link http://mysite.co.uk/about/profiles/ it works fine and for the life of me I cant understand what I have done wrong. Warning: include(/var/www/mysite/about//about/about.php) [function.include]: failed to open stream: No such file or directory in /var/www/mysite/about/index.php on line 22 Warning: include() [function.include]: Failed opening '/var/www/mysite/about//about/about.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/mysite/about/index.php on line 22 I am a kinda of newbie so any help/guidance will be gratefully received Hello, I am pasting code below that isn't working corrrectly. One problem is the pagination. When I get more than 10 records, it will show the next 10 link but when I click on it, it just takes me back to an empty page with NO results. How do I fix this? Also where do I insert the block of code for a table to structure my results. As of now, the returned results are all over the page! Thanks! This is the code: Code: [Select] <?php // display what the person searched for echo "<p>You searched for: "" . $var . ""</p>"; // begin to show results set echo "Results"; $count = 1 + $s ; // now you can display the results returned while ($row= mysql_fetch_array($result)) { $title = $row["1st_field"]; echo "$count.) $title" ; $count++ ; } $currPage = (($s/$limit) + 1); //break before paging echo "<br />"; // next we need to do the links to other results if ($s>=1) { // bypass PREV link if s is 0 $prevs=($s-$limit); print " <a href=\"$PHP_SELF?s=$prevs&q=$var\"><< Prev 10</a>  "; } // calculate number of pages needing links $pages=intval($numrows/$limit); // $pages now contains int of pages needed unless there is a remainder from division if ($numrows%$limit) { // has remainder so add one page $pages++; } // check to see if last page if (!((($s+$limit)/$limit)==$pages) && $pages!=1) { // not last page so give NEXT link $news=$s+$limit; echo " <a href=\"$PHP_SELF?s=$news&q=$var\">Next 10 >></a>"; } $a = $s + ($limit) ; if ($a > $numrows) { $a = $numrows ; } $b = $s + 1 ; echo "<p>Showing results $b to $a of $numrows</p>"; ?> MOD EDIT: [code] . . . [/code] BBCode tags added. |