Jump to content

The Eagle

Members
  • Posts

    132
  • Joined

  • Last visited

    Never

Everything posted by The Eagle

  1. Why don't you stop criticizing me? How do I know what you're talking about? You've proposed no intelligent hints as where to go. That code is actually working on my side, maybe you should read that topic before you start giving advice.
  2. The exit(); function stops the reading, and the error process of some scripts. It's likely not the issue, but it is common to some scripts, and it may have been the issue, most likely not. Variables are good to work with, $xy_total = "$center_total"($x) { if ($x > 999); $y = 12; } center_total(1000); imagestring($image, 3, (119+$y), ((1210-(($total_calls/560)*50))-15), "$total_calls", $black); Goodluck!
  3. xtopolis, store_categories as c on c.id = si.cat_id where si.id = $_GET[item_id]"; This may grab something from the categories. But your idea may be correct, this is the ONLY tag listed in that script that can grab and identify $item_id.
  4. Exiting it can make it so it will stop reading it. I'm saying, it's an exit tag issue occasionally.
  5. This is a common issue for mostly ALL scripts in PHP. Firstly, try the method provided by josh above. If that doesn't resolve it, add exit(); to the end (before <?) G'Luck! :o :o
  6. Take a look, I've done the work. ;) <!-- on top of the page --> <?php // Sanchi, please put your email below here. $mailto = "sanchi@yourdomain.com"; # Maximum file size (IN BYTES $max_attach_size = 500000; ?> <!-- END on top of the page --> <!-- START PHP form --> <?php /*if (empty($_POST['form_submitted'])) { ?><p>Please fill out the form:</p> <?php } */ if (isset($_POST["form_submitted"])) { $name = $_POST['name']; $email = $_POST['email']; $text = $_POST['text']; unset($errors); if ($email != "" and !preg_match("/^[^@]+@.+\.\D{2,5}$/", $email)) $errors[] = "E-mail address seems to be incorrect"; if ($name != "") $errors[] = "Please enter your name"; if ($_FILES['attachm']['size'] > $max_attach_size) $errors[] = "Attachment file size is too big(".number_format($_FILES['attachm']['size']/1000,0,",","")." KB) - maximum size: ".number_format($max_attach_size/1000,0,",","")." KB"; if (empty($errors)) { $text = stripslashes($text); if ($name != "") $mail_name=$name; else $mail_name="SPAM!!"; if ($email != "") $mail_email = $email; else $mail_email = "sanchi@yourdomain.com"; $ip = $_SERVER["REMOTE_ADDR"]; // if attachment, MIME-Mail: if (isset($_FILES['attachm']['name']) && trim($_FILES['attachm']['name']) != "") { // read and encode file: $datei_content = fread(fopen($_FILES['attachm']['tmp_name'],"r"),filesize($_FILES['attachm']['tmp_name'])); $datei_content = chunk_split(base64_encode($datei_content),76,"\n"); // Boundary: $boundary = md5(uniqid(rand())); // Mail-Header: $mail_header = "From: ".$mail_name." <".$mail_email.">\n"; $mail_header .= "X-Sender-IP: ".$ip."\n"; $mail_header .= "MIME-Version: 1.0\n"; $mail_header .= "Content-Type: multipart/mixed; boundary=\"".$boundary."\"\n"; $mail_header .= "This is a multi-part message in MIME format.\n"; // Mail-Text: $mail_header .= "--".$boundary; $mail_header .= "\nContent-Type: text/plain"; $mail_header .= "\nContent-Transfer-Encoding: 8bit"; $mail_header .= "\n\n".$text; // Attachment: $mail_header .= "\n--".$boundary; $mail_header .= "\nContent-Type: ".$_FILES['attachm']['type']."; name=\"".$_FILES['attachm']['name']."\""; $mail_header .= "\nContent-Transfer-Encoding: base64"; $mail_header .= "\nContent-Disposition: attachment; filename=\"".$_FILES['attachm']['name']."\""; $mail_header .= "\n\n".$datei_content; // End: $mail_header .= "\n--".$boundary."--"; // Sende E-Mail und gebe Fehler bzw. Bestaetigung aus if (@mail($mailto,$mail_subject,"",$mail_header)) $sent = true; else $errors[] = "no connection to the mailserver - please try again later"; } // no attachment, normal E-mail: else { $mail_header = "From: ".$mail_name." <".$mail_email.">\n"; $mail_header .= "X-Sender-IP: $ip\n"; $mail_header .= "Content-Type: text/plain"; if (@mail($mailto,$mail_subject,$text,$mail_header)) $sent = true; else $errors[] = "no connection to the mailserver - please try again later"; } // copy to sender: if (isset($sent) && isset($email) && $email != "" && isset($_POST['copy'])) { if (isset($_FILES['attachm']['name']) && trim($_FILES['attachm']['name']) != "") $copy_mail_text = "Copy of the e-mail:\n\n".$text."\n\nAttachment: ".$_FILES['attachm']['name']; else $copy_mail_text = "Copy of the e-mail:\n\n".$text; $header= "From: ".$mailto."\n"; $header .= "X-Sender-IP: ".$ip."\n"; $header .= "Content-Type: text/plain"; @mail($email, $mail_subject, $copy_mail_text, $header); } } } if (empty($sent)) { if(isset($errors)) { ?><p>Error:</p><ul> <?php foreach($errors as $f) { ?><li> <?php echo $f; ?></li><?php } ?></ul> <br /><?php } ?><form name='myform' method="post" action="" enctype="multipart/form-data"><div> <table cellpadding="2" cellspacing="0"> <tr> <td class="style66" width="100">Your Name:</td> <td class="style66"><input name="name" value="<?php if (isset($name)) echo htmlentities(stripslashes($name)); else echo ""; ?>" size="25" /></td> </tr> <tr> <td class="style66">E-mail Address:</td> <td class="style66"><input name="email" value="<?php if (isset($email)) echo htmlentities(stripslashes($email)); else echo ""; ?>" size="25" /></td> </tr> <tr> <td class="style66">Message:<br>(optional)</td> <td class="style66"><textarea name="text" cols="25" rows="7"><?php if (isset($text)) echo htmlentities(stripslashes($text)); else echo ""; ?></textarea></td> </tr> <tr> <td class="style66">Attach file:</td> <td class="style66"><input type="file" name="attachm" value="<?php if (isset($_POST['attachm'])) echo htmlentities(stripslashes($_POST['attachm'])); else echo ""; ?>" size="16" /></td> </tr> <tr> <td></td> <td class="style66" colspan="2"><input type="checkbox" name="copy" value="true" />Send copy to yourself?</td> </tr> <tr> <td></td> <td class="style66"><input type="submit" name="form_submitted" value="Submit!" /></td> </tr> </table> </div></form> <?php } else { if (empty($email)) { ?> <p class="style66">Thank you.<br />Your mail has been sent, but your email address is missing!</p> <?php } else { ?> <p class="style66">Thank you very much for your submission.<br />Your message has been successfully sent and received!</p> <?php } } ?> <!-- END PHP form -->
  7. Let's clarify this a bit more, you want a contact form with attachment option? Or do you just want attachment options to be e-mailed to a specified e-mail address. ??? ??? ???
  8. I've answered your question on your other topic, http://www.phpfreaks.com/forums/index.php/topic,259413.0.html. Please refer to this topic to get the appropriate answer for your question, and take Mabismad's advice, please do not create duplicate topics, it will drastically decrease your amount of support. :-X
  9. Okay, this is very obvious to me. <?php /* subject and email variables */ $emailSubject = 'Client Query!'; $webMaster = 'myemail'; In this part above, you're supposed to identify your e-mail address and the subject of the email sent to you. Take this example below. <?php /* subject and email variables */ $emailSubject = 'New contact message received!'; $webMaster = 'eagle@vazzer.net; Just replace "eagle@vazzer.net" with your email. 8)
  10. Please post the code of "thispage.php" so we can identify the integers and variables that this script is trying to pass-through.
  11. Seems like a minor mistake made by the developer / author of that script, the tag before the ending PHP "<?" has an exit statement, which is displayed as exit; Try replacing the above code with exit(); That's the right sequence used to be followed. :-\
  12. After reading your second post, I do still believe a search engine will fit your needs. There is another possibility, I do not know if you're looking for this or not. It's called a radio button redirect, or as in my mind it is. It uses no PHP, and just Javascript, which may cause {slight} problems if the user has no Javascript enabled, so this may be a "last resort." <html> <head> <title>Radio Button Redirect</title> <SCRIPT type="Text/JavaScript" LANGUAGE="JavaScript"> <!-- Begin function go(loc) { window.location.href = loc; } // End --> </script> </head> <body> <td valign=top> <div><center> <form name="form" action="pagename.html"><b>Pick your choice:</b><br> <BR><table border=0 cellpadding=5><tr><td> <input type="radio" name="loc" style="color: #092445; background-color: #FFFFFF; border: 1px #ffffff solid;" onClick="go('pagename.html');" alt=""></td><td><font face=verdana size=2>Selection #1</font></td></tr><tr><td> <input type="radio" name="loc" style="color: #092445; background-color: #FFFFFF; border: 1px #ffffff solid;" onClick="go('pagename.html');" alt=""></td><td><font face=verdana size=2>Selection #2</font></td></tr><tr><td> <input type="radio" name="loc" style="color: #092445; background-color: #FFFFFF; border: 1px #ffffff solid;" onClick="go(''pagename.html'');" alt=""></td><td><font face=verdana size=2>Selection #3</font></td></tr><tr><td> <input type="radio" name="loc" style="color: #092445; background-color: #FFFFFF; border: 1px #ffffff solid;" onClick="go('pagename.html'');" alt=""></td><td><font face=verdana size=2>Selection #4</font></td></tr></table> <BR><BR><BR> </form> </html> It's useful in some situations. You may see a live demo of it on my website. http://www.vazzer.net/chooseyourclass.html I made that awhile ago, so don't mind the crazyness of it .
  13. After investigating into your issue, I do believe a search engine would most fit your needs. You can use one of the free ones (e.g: Google Search Engine, Pax.com Search tab). You may also use the one I've made temporarily Below is the HTML to your webpage, so it may be searched. <html> <head> <title>Web Search</title> </head> <form name="form1" method="POST" action="search.php"> <table width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="36%"> <div align="center"> <input type="text" name="keyword"> </div> </td> <td width="64%"> <input type="submit" name="Submit" value="Search!"> </td> </tr> </table> </form> </body> </html> Then you should create a file named "search.php". Put the following code into this new file. <?php function listFiles($dir){ $handle=opendir($dir); while(false!==($file=readdir($handle))){ if($file!="."&&$file!=".."){ //if it is a directory, then continue if(is_dir("$dir/$file")){ listFiles("$dir/$file"); } else{ //process the searching here with the following PHP script } } } } function listFiles($dir,$keyword,&$array){ $handle=opendir($dir); while(false!==($file=readdir($handle))){ if($file!="."&&$file!=".."){ if(is_dir("$dir/$file")){ listFiles("$dir/$file",$keyword,$array); } else{ //read file $data=fread(fopen("$dir/$file","r"),filesize("$dir/$file")); //avoid search search.php itself if($file!="search.php"){ //contain keyword? if(eregi("$keyword",$data)){ $array[]="$dir/$file"; } } } } } } //define array $array $array=array(); //execute function listFiles(".","php",$array); //echo/print search results foreach($array as $value){ echo "$value"." \n"; } ?> Now, combine the programs listed above, you will find all the related results in your websites will be found and listed. A further optimization of the search engine can be taken by adding the following, 1,list the title of all searching results REPLACE THE FOLLOWING if(eregi("$keyword",$data)){ $array[]="$dir/$file"; } WITH if(eregi("$keyword",$data)){ if(eregi("<title>(.+) </title>",$data,$m)){ $title=$m["1"]; } else{ $title="no title"; } $array[]="$dir/$file $title"; } 2,Add links to searching results CHANGE THE FOLLOWING foreach($array as $value){ echo "$value"." \n"; } TO foreach($array as $value){ list($filedir,$title)=split("[ ]",$value,"2"); echo "$value"." \n"; } // ADD THE FOLLOWING AT THE BEGINNING OF PHP FILES set_time_limit("600"); set_time_limit("600"); $keyword=trim($_POST["keyword"]); if($keyword==""){ echo"Please enter your keyword"; exit; } function listFiles($dir,$keyword,&$array){ $handle=opendir($dir); while(false!==($file=readdir($handle))){ if($file!="."&&$file!=".."){ if(is_dir("$dir/$file")){ listFiles("$dir/$file",$keyword,$array); } else{ $data=fread(fopen("$dir/$file","r"),filesize("$dir/$file")); if(eregi("<body([^>]+)>(.+)</body>",$data,$b)){ $body=strip_tags($b["2"]); } else{ $body=strip_tags($data); } if($file!="search.php"){ if(eregi("$keyword",$body)){ if(eregi("<title>(.+)</title>",$data,$m)){ $title=$m["1"]; } else{ $title="no title"; } $array[]="$dir/$file $title"; } } } } } } $array=array(); listFiles(".","$keyword",$array); foreach($array as $value){ list($filedir,$title)=split("[ ]",$value,"2"); echo "$title "." \n"; } If you wish, you may add this to the VERY top of the PHP code to alert the user when no words have been typed into the box. //get keywords $keyword=trim($_POST["keyword"]); //check if the keyword is empty if($keyword==""){ echo"no keywords"; exit; } ?>
  14. Hello CrazyGlue You're referring to, well I do believe, a search tab feature on your website. At the time being, I am not aware of a way for them to be able to be redirected to a certain part of a website with text entry. I know of a way, with includes Javascript, of them to click a button (radio button) and be redirected to a page specified by the code. Let me know, but I will look into this for you.
  15. Dependent on your host, most hosts do allow the creation and usages of MySQL databases. Your control panel, quite possibly may be cPanel, you have an option if you scroll down the page quite a bit. You will need to identify your database to your HTML form, too.
  16. What is the issue you're receiving/having?
  17. You can use the POST methods to save on a web page. Anyways, you may want to look into MySQL databases for recording and holding logged messages.
  18. Try the suggested exit(); statement.
  19. You should not mess with the configuration set in this file, this is helping you identify your MySQL server / login information. $hostname is the address to your MySQL server. $database is the name of the MySQL database the application will use. $username is the username you most-likely log in with. $password is the password you most-likely use to log in. If you're looking to add more fields, which is highly unneeded and may potentially make this application not work, you would have to identify the variables such as $security = "$_GET(); It's highly complex, especially if you're not that well in the PHP language.
  20. I am saying your form actions and the echo statements inside your form are faulty and may be potentially identifying incorrectly if the statements do not match the variables.
  21. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> I do not think the <?php is needed in this. Start the PHP (<?php) code before the <form action=""> Then end it (?>) after the </form>
  22. DATE() DATE_FORMAT() THEDATE()
  23. I beg to differ dezkit, why would you enter it before ordering the script to calculate the points, when it could be able to calculate the date before registering the points. You can try dezkit's version, than try mine. Add your code before WHERE Player.MembershipNo = SubSelect.MembershipNo
  24. MySQL is a great addition to learn before working with some blogging in PHP. WordPress is not the best software to decipher codes from, but it's highly one of the most effecient. I cannot find another one more efficient and effective as this one. <echo "Good Luck!"
  25. You may want to use a POST method with the $id tags Such as, $id=$_POST['id'];
×
×
  • 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.