Jump to content

keefy

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Everything posted by keefy

  1. Thanks members Ive got the right code now... <?php if ( $row [ 'propertyoption' ] == "R" ) { echo "Add your text here ..."; } ?>
  2. It does not work intodesi maybe ive asked wrong.. 1st of all the database is already open, i have a script which is actually showing properties, i used pp_goods and features as an example.. so will give the correct tables then it might make things a little easier, sorry i should have just done that in the first place. I have a website and it shows rentals and sales... the script was bought. however i need it to display some text "Long term rentals available" when showing a rental... In the database i have a table called pm_properties below is what is in the config.php $property_table = "pm_properties"; If i go into phpmyadmin i have a table called pm_properties in that table i have a field called propertyoption which holds either R or S depending on sale or rental. I would like:- If propertyoption = R then put "Long term rentals available" on the screen. Sorry for been so confusing....
  3. Im sorry but ive searched and could not find, i know this will be easy for most people but im new and trying my best to understand. My simple need is:- I want to be able to show some text "some example text" on my website only if the feature from table pp_goods is = to Y. I have a table called pp_goods in side that table, if i browse i have ID, goodsname, Feature etc in feature it stores only Y or N Please help me on my way... Thanks
  4. Thank you very much hitman6003 It now works Does the ("adminmailaddress") need removing ? This gets the email address from the database which is the same as the -fyourmail@yourdomain.whatever without the -f @mail ( $cgi->getValue ( "adminemailaddress" ), $yoursubject, $emailtext, "From: " . $cgi->getValue ( "email" ), "-fyourmail@yourdomain.whatever" );
  5. Hi, Ive got a paid property script on my website, The script works ok on one of my sites, but the site i want it to work on seems to send the form but i never recieve it in my email... The hosting company says:- Thank you for your query This issue is occuring because there is a missing fifth parameter in your mail script. This has always been a requirement of mail scripts on our shared hosting platform but recent updates to our Linux servers (from PHP4 to PHP5) has meant that this is now always required. An example of how to use can be found below: What is the path to Sendmail? /usr/sbin/sendmail -fuser\@domainname.co.uk You need to replace -fuser\@domainname.co.uk with a valid mailbox on your account: ie -froot\@yourdomain.co.uk You must leave in the -f and make sure there is a \ before the @ An example of how to use this is displayed below: mail($to, $sub, $mess, "From: root@yourdomain.co.uk", "-froot@yourdomain.co.uk"); Please note when sending email from a script on your website either the to or from address needs to be a valid email account that is setup, eg root@yourdomain.co.uk Ive sent a email to the author of the script and he says - "I have never heard of PHP mail being used like this before!!" Below is the script from the property script, Can anyone help me change it so that its compatible to what the hosting company has said... <script language="JavaScript" type="text/javascript"> <!-- Begin var submitcount=0; function reset() { document.emailform.name.value=""; document.emailform.email.value=""; document.emailform.address.value=""; } function checkFields() { if ( (document.emailform.name.value=="") || (document.emailform.email.value=="") || (document.emailform.address.value=="")) { alert("<?php echo GENERAL_FORM_POPUP_ERROR_MESSAGE; ?>"); return false; } } // End --></script> <?php if ( $cgi->getValue ( "op" ) == "SendInformationRequest" ) { // Contact Form Spam Check for Website URl's which should not be there $SpamErrorMessage = "<p align=\"center\"><font color=\"red\">Website URLs are not permitted in the request form.</font></b></p>"; if (preg_match("/http/", "" . $cgi->getValue ( "name" ) . "")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/", "" . $cgi->getValue ( "email" ) . "")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/", "" . $cgi->getValue ( "telephone" ) . "")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/", "" . $cgi->getValue ( "address" ) . "")) {echo "$SpamErrorMessage"; exit();} $yoursubject = "".EMAIL_SUBJECT." Ref: " . $cgi->getValue ( "propertyref" ); $emailtext = " ----------------------------------------------------------------------------- ".EMAIL_TEXT_TITLE." ----------------------------------------------------------------------------- ".EMAIL_TEXT_BODY." ".EMAIL_PD." ".EMAIL_PROEPRTY_REF." " . $cgi->getValue ( "propertyref" ) . " ".EMAIL_PROPERTY_ADDRESS." " . $cgi->getValue ( "propertyaddress" ) . " ".EMAIL_PROPERTY_PRICE." ".CURRENCY."" . $cgi->getValue ( "propertyprice" ) . " ".EMAIL_RD." ".EMAIL_NAME." " . $cgi->getValue ( "name" ) . " ".EMAIL_EMAIL_ADDRESS." " . $cgi->getValue ( "email" ) . " ".EMAIL_TELEPHONE." " . $cgi->getValue ( "telephone" ) . " " . $cgi->getValue ( "address" ) . " _____________________________________________________________ ".EMAIL_FOOTER."www.egypt4property.com/index.php?op=mi&id=" . $cgi->getValue ( "id" ) . " "; $yoursubject = stripslashes ( $yoursubject ); $emailtext = stripslashes ( $emailtext ); @mail ( $cgi->getValue ( "adminemailaddress" ), $yoursubject, $emailtext, "From: " . $cgi->getValue ( "email" ) ); ?> <br /> <br /> <br /> <p align="center"><?php echo EMAIL_SUCCESS_MESSAGE; ?></p> Thanks for any help Keefy
  6. Thanks fenway but im trying to write this in a php to show on my website, i thought it needed the $sql in the line ???? Im so sorry but i just cant get my head round it, i think that once i have the full code so that it shows on my website, then i will be able to understand it better. this is what i got from the comment script site which ive added to a php file to try and get it show the result on a webpage, but it does not work:- <?php require '_connect.php'; ?> //connect to the database <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title></title> </head> <body> <?php $sql = SELECT count(*) as num FROM "c5t_comment" WHERE comment_identifier='/hotels/anglo.php'"; $result = mysql_query($sql); $num_comments = mysql_result ($result,0,`num`); ?> <a href="/your/page/">Click here to see all <? echo $num_comments ?> comments</a> </body> </html> I hope im not annoying anyone in my persistence to understand this... Keefy
  7. Thanks all but since im very new to this and just started reading on it, is it possible 1 of you members can spare just a few mins and post me the full code what would be needed to fetch how many comments are left ? ive already learned how to connect to the database so im ok with that - im sure i will have hundreds more questions when i get myself more into php and sql. I need to get from table c5t_comment how many times in comment_identifier that /hotels/anglo.php is listed BUT comment_status must equal 0 i have MySQL 4.1.15-standard - phpMyAdmin 2.6.4-pl4 Thanks for your patience with me Keefy
  8. Thanks for your reply php_dave, tried that in sql and it did not work:- MySQL said: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$sql = "SELECT count(*) as num FROM `c5t_comment` WHERE comment_ i have MySQL 4.1.15-standard - phpMyAdmin 2.6.4-pl4
  9. On the comment script forum, where no-one as posted for a long time someone had already asked the question i asked above and got this code:- <?php $sql = "SELECT count(*) as num FROM `c5t_comment` WHERE comment_identifier='/hotels/anglo.php"; $result = mysql_query($sql); $num_comments = mysql_result ($result,0,"num"); ?> <a href="/your/page/">Click here to see all <? echo $num ?> comments</a> however i get this error when i run it:- Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/fhlinux209/l/mysite.com/user/htdocs/restaurants/testc.php on line 13 Click here to see all comments line 13 is:- $num_comments = mysql_result ($result,0,"num"); Thanks for any help
  10. Hi All...like the subject says im new to sql and i need a some help... I have on my website a comment script which is added to many pages for people to leave comments on certain restaurants in egypt. I want to place on another page how many comments have been left for each restaurant, just a simple Comments left = ? I have a table called c5t_comment, inside the table i have comment_id, comment_identifier_id, comment_identifier, comment_status plus more. All im intrested in is getting from table c5t_comment how many times in comment_identifier is = to /restaurants/hamees.php BUT comment_status = 0 the comment status if its = 100 it means its not been approved = 0 means it has been approved. Can anyone help ? Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.