Jump to content

Alexhoward

Members
  • Posts

    310
  • Joined

  • Last visited

    Never

Everything posted by Alexhoward

  1. Hi guys, this site has been a real help to me, and once again i have to turn to the experts! i've made a nice paging script that does exactly want i want (well chuffed ) now i've found a search script, which with help from the phpfreaks masters has been modified to meet my criteria, the problem is i have no idea how to put them together, so it displays the results as the paging script does... could someone please help me I keep playing with it but don't know where to start! the script is horrible to look at, so i'll post it if someone would be kind enough ( or is just curious enough ) to have a look Thankyou!
  2. Also: Additional Info : Browser Info: Referral : does not work, but i'm still working on it...
  3. Hi Ken, thanks for replying I contacted my host and they've sorted it out. my code now looks like this mail form: <form method="post" action="sendemail.php"> <!-- DO NOT change ANY of the php sections --> <?php $ipi = getenv("REMOTE_ADDR"); $httprefi = getenv ("HTTP_REFERER"); $httpagenti = getenv ("HTTP_USER_AGENT"); ?> <input type="hidden" name="ip" value="<?php echo $ipi ?>" /> <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" /> <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" /> 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 /> </form> and the send script: <?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 "; ini_set("sendmail_from", "root@everyonlinestore.co.uk"); mail("root@everyonlinestore.co.uk", $subject, $message, "From: root@everyonlinestore.co.uk", "-froot@everyonlinestore.co.uk"); ?> <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> where i had to "ini_set("sendmail_from", "root@everyonlinestore.co.uk");" are you saying i should change: "-froot@everyonlinestore.co.uk" to: "-f root@everyonlinestore.co.uk"...? i'd really like it to think it was coming from the users email address inputted into the form Thanks for your help
  4. Hi, thanks for replying are you on a windows server...?
  5. oh, just incase anyone is wondering. the knowledge base on for my host says i need the 5 parameters. not sure what the -f and \@ is for but that's what they say, however... nothing is coming through, and i'm not getting any errors...
  6. Hi, I'm using Streamline.net as my server. 1st of all... is anyone else? I've got a test mail script, but i'm not receiving anything... Just wondering if anyone else has encountered this problem, and managed to solve it here's the code: <?php $to = "root@everyonlinestore.co.uk"; $sub = "testing"; $mess = "is it working"; mail($to, $sub, $mess, "From: root@everyonlinestore.co.uk", "-froot\@everyonlinestore.co.uk"); ?> Thanks in advance!!
  7. i do have access to the log files on my ftp server but they mean nothing to me.... what should i be looking for?
  8. Hi, for the error...? i just assume it's being blocked or something? i'll email them Thanks
  9. Thanks! however, nothing is coming through, just sent a test from hotmail to the same address, and it turned up straight away.....?
  10. Hi, I've tried your suggestion in a number of ways, but i'm still not recieving anything my webhosts say on their website: You can also use the PHP mail function and set the mail "from address" using the following line of code (replacing email@mydomain with the correct domain name). ini_set("sendmail_from", " email@mydomain "); but i don't understand...
  11. Thanks for your reply, so you're saying from: $from = "From: $visitormail\r\n"; to $from = "From: mail@yourdomain.com"; sorry if this is a really stupid question...
  12. Hi, Is there anyone out there that can point me in the right direction...? Im not asking for someone to do it for me, so i can just copy and paste, i like learning this stuff but this is doing my head in... i have no idea why it doesn't work Thanks!
  13. That sounds nice... but mysql has gone down at the moment....! well... for the past 2 days!?! so i'd like to try this way, plus i think it's an easier way. thanks for your suggestion thou!
  14. Google it, You'll find one straight away...
  15. Hi Guys, i've modified a contact us script but it's not actualling sending anything... (or i'm not receiving it....) does anyone have the time to please tell me why...? contact.php <!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>EveryOnlineStore.co.uk Email Form </title> </head> <body> </body> <?php include ("banner.php"); ?> <form method="post" action="sendemail.php"> <!-- DO NOT change ANY of the php sections --> <?php $ipi = getenv("REMOTE_ADDR"); $httprefi = getenv ("HTTP_REFERER"); $httpagenti = getenv ("HTTP_USER_AGENT"); ?> <input type="hidden" name="ip" value="<?php echo $ipi ?>" /> <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" /> <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" /> 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 /> </form> </body> </html> sendemail.php <!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>EveryOnlineStore.co.uk is sending the message...</title> </head> <body> <?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("your@website.co.uk", $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> Thanks in Advance!!
  16. bored so thought i'd ask is anyone else using it?
  17. ah, OK, so i should change the names of the columns to something like... cat, subcat but i've lost connection with mysql, so it's a waiting game at the mo... Thanks
  18. OK, why not... i'll give it a go.... but oh no...my servers gone down...!
  19. hello! $query2="SELECT link FROM links WHERE group = 'shopping' and subgroup = 'mall'"; getting the error: 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 'group = 'shopping' and subgroup = 'mall'' at line 1 this works fine everywhere else.. can anyone help me? Thanks
  20. Hi, I'm no good at this, i've come a long long way, but this code is hard to look at. basically when you click on the "next 10" link, it displays the same results, here's the code so far...? with help from uniflare (thanks again) <?php include ("banner.php") ?> <html> <body> <form name="form" action="searchscript.php" method="get"> <input type="text" name="q" /> <input type="submit" name="Submit" value="Search" /> </form> <?php $page = "searchscript.php"; // Get the search variable from URL $var = @$_GET['q'] ; $trimmed = trim($var); //trim whitespace from the stored variable // rows to return $limit=10; // check for an empty string and display a message. if ($trimmed == "") { echo "<p>Please enter a search...</p>"; exit; } // check for a search parameter if (!isset($var)) { echo "<p>We dont seem to have a search parameter!</p>"; exit; } //connect to your database ** EDIT REQUIRED HERE ** mysql_connect("host","username","password"); //specify database ** EDIT REQUIRED HERE ** mysql_select_db("database_name") or die("Unable to select database"); //select which database we're using // WHERE QUERY BUILDER ///// // Split into array of keywords $kw = @explode(" ",$var); // Get number of keywords $x = (!is_array($kw))? "1" : count($kw); // Loop for each keyword adding a where query each time. For($i=0;$i<$x;$i++){ // the current keyword (made safe from mysql_injection), depending on wether the explode() worked or not. $key = ($x==1)? mysql_escape_string($var) : mysql_escape_string($kw[$i]); // Add the where item as an appended array. $where[] = "`keywords` LIKE '%$key%' OR `link` LIKE '%$key%'"; } // Get full where query using the array created $where = "WHERE ".implode(" OR ",$where); // --------------- END WHERE BUILDER // Build SQL Query $query = "select `link` from `links` $where order by `company_name`"; // EDIT HERE and specify your table and field names for the SQL query $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); if ($numrows == 0) { echo "<h4>Results</h4>"; echo "<p>Sorry, your search: "" . $trimmed . "" returned zero results</p>"; } // next determine if s has been passed to script, if not use 0 if (empty($s)) { $s=0; } // get results $query .= " limit $s,$limit"; $result = mysql_query($query) or die("Couldn't execute query"); // 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["link"]; 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=\"$page?s=$prevs&q=$var\"><< Prev 10</a>&nbsp "; } // 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=\"$page?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>"; ?> </body> </html> also, i'd like to display them like this (as seen on www.everyonlinestore.co.uk (not advertising... just for reference as of what the code does) ): <?php include("xxxxxxxxx.php"); // connect to the mysql server $link = mysql_connect($server, $db_user, $db_pass) or die ("Could not connect to mysql because ".mysql_error()); // Select the jokes database if (!@mysql_select_db('database_name')) { exit('<p>Unable to locate the links ' . 'database at this time.</p>'); } if (!isset($_GET['start'])) { $_GET['start'] = 0; } if (!isset($_GET['p_f'])) { $_GET['p_f'] = 0; } require "xxxxxxxxxx.php"; // All database details will be included here $page_name="members.php"; // If you use this code with a different page ( or file ) name then change this $start= $_GET['start']; // To take care global variable if OFF if(!($start > 0)) { // This variable is set to zero for the first page $start = 0; } $eu = ($start -0); $limit = 12; // No of records to be shown per page. $this1 = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; $mysite_username = $_COOKIE["mysite_username"]; /////////////// WE have to find out the number of records in our table. We will use this to break the pages/////// $query2=" SELECT link FROM memberlinks WHERE username = '$mysite_username'"; $result2=mysql_query($query2); echo mysql_error(); $nume=mysql_num_rows($result2); /////// The variable nume above will store the total number of records in the table//// ////////////// Now let us start executing the query with variables $eu and $limit set at the top of the page/////////// $query=" SELECT link FROM memberlinks WHERE username = '$mysite_username' limit $eu, $limit "; $result=mysql_query($query); echo mysql_error(); echo "<table width='100%' border='0'>"; // display the users in table $c = 0; while($row = mysql_fetch_array($result)) { $user2 = html_entity_decode($row['link']); if($c%3 == 0) echo "<tr>"; // If the counter has ticked 5 times, start a new row. echo "<td scope='row' height='150' width='25%' align='center' valign='middle' class='bkgrnd'>$user2</td>"; if($c%3 == 2) echo "</tr>"; // If we're drawing the 6th pic, end this row. $c++; } if($c%5 != 4) echo "</tr>"; // If there isn't a number of pics divisible by 6, end the row echo "</table>"; // end the table ////////////////////////////// End of displaying the table with records //////////////////////// ///// Variables set for advance paging/////////// $p_limit=12; // This should be more than $limit and set to a value for whick links to be breaked $p_f= $_GET['p_f']; // To take care global variable if OFF if(!($p_f > 0)) { // This variable is set to zero for the first page $p_f = 0; } $p_fwd=$p_f+$p_limit; $p_back=$p_f-$p_limit; //////////// End of variables for advance paging /////////////// /////////////// Start the buttom links with Prev and next link with page numbers ///////////////// echo "<table align = 'center' width='80%'><tr><td align='left' width='20%'>"; if($p_f<>0){print "<a href='$page_name?start=$p_back&p_f=$p_back'><font face='Verdana' size='2'>PREV</font></a>"; } echo "</td><td align='left' width='10%'>"; //// if our variable $back is equal to 0 or more then only we will display the link to move back //////// if($back >=0 and ($back >=$p_f)) { print "<a href='$page_name?start=$back&p_f=$p_f'><font face='Verdana' size='2'>PREV</font></a>"; } echo "</td><td align='right' width='10%'>"; ///////////// If we are not in the last page then Next link will be displayed. Here we check that ///// if($this1 < $nume and $this1 <($p_f+$p_limit)) { print "<a href='$page_name?start=$next&p_f=$p_f'><font face='Verdana' size='2'>NEXT</font></a>";} echo "</td><td align='right' width='20%'>"; if($p_fwd < $nume){ print "<a href='$page_name?start=$p_fwd&p_f=$p_fwd'><font face='Verdana' size='2'>NEXT</font></a>"; } echo "</td></tr></table>"; ?> Thanks for all your help!!!
  21. Hi guys, i'd like to make a category list on the side of my page, that when you click one it opens up to show the sub categories, then when you click it again it closes back up. but, i don't know what you'd call it, and as such google searched aren't really helping could someone please point me in the right direction Thanks in advance
  22. Excellent! sorry! what a doof! Thanks a load!!!!
  23. hi, ok the echo is bringing back: select link from links where keywords like "%argos shop%" order by company_name limit 0,10
×
×
  • 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.