Jump to content

eaglelegend

Members
  • Posts

    353
  • Joined

  • Last visited

    Never

Everything posted by eaglelegend

  1. if I change the varible - whichever one it is, wouldnt it change say what tld it is? so if I changed co.uk to couk wouldnt the tld it is looking for be couk instead? also period is . yes?
  2. Hi, On my PHP application I guess you might call it, that searches for available, and non available domain names, it works, but if I am to make a .co.uk tld so users can see if say www.phpfreaks.co.uk is available, when I upload it onto my server, it dont show the form, or the whole of the bottom of the page, I am just wondering whats going on here :s, if you can help, that would be great!, thanks in advance. here is the code that is causeing the issue <p> <div id="main"> <div id="caption"><b>Domain Lookup</b></div> <div id="icon"> </div> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="domain" id="domain"> Domain name: <table> <tr><td><input class="text" name="domainname" type="text" size="36"/></td></tr> <tr> <td> <input type="checkbox" name="all" checked />All <input type="checkbox" name="com"/>.com <input type="checkbox" name="net"/>.net <input type="checkbox" name="org"/>.org <input type="checkbox" name="info"/>.info <input type="checkbox" name="edu"/>.edu <input type="checkbox" name="co.uk"/>.co.uk </td></tr> <tr><td align="center"><br/><input class="text" type="submit" name="submitBtn" value="Check domain"/></td></tr> </table> </form> <?php if (isset($_POST['submitBtn'])){ $domainbase = (isset($_POST['domainname'])) ? $_POST['domainname'] : ''; $d_all = (isset($_POST['all'])) ? 'all' : ''; $d_com = (isset($_POST['com'])) ? 'com' : ''; $d_net = (isset($_POST['net'])) ? 'net' : ''; $d_org = (isset($_POST['org'])) ? 'org' : ''; $d_info = (isset($_POST['info'])) ? 'info' : ''; $d_edu = (isset($_POST['edu'])) ? 'edu' : ''; $d_co.uk = (isset($_POST['co.uk'])) ? 'co.uk' : ''; // Check domains only if the base name is big enough if (strlen($domainbase)>2){ ?> <div id="caption">RESULT</div> <div id="icon2"> </div> <div id="result"> <table width="100%"> <?php if (($d_com != '') || ($d_all != '') ) showDomainResult($domainbase.".com",'whois.crsnic.net','No match for'); if (($d_net != '') || ($d_all != '') ) showDomainResult($domainbase.".net",'whois.crsnic.net','No match for'); if (($d_org != '') || ($d_all != '') ) showDomainResult($domainbase.".org",'whois.publicinterestregistry.net','NOT FOUND'); if (($d_info != '') || ($d_all != '') ) showDomainResult($domainbase.".info",'whois.afilias.net','NOT FOUND'); if (($d_edu != '') || ($d_all != '') ) showDomainResult($domainbase.".edu",'whois.internic.net','No match for'); if (($d_co.uk != '') || ($d_all != '') ) showDomainResult($domainbase.".co.uk",'whois.nic.uk','No match'); ?> </table> </div> <?php } } ?> </div></p> <center>
  3. Hi!, I found this free favicon generator code off the net, though as it didnt actually upload to my site when I asked, I am beginning to wonder, does it actually work?? Since I still cannot master PHP, I am guessing that the code, being an upload type of code, it can be risky, because my experience with upload codes in the past have not been very sweet tbh - hackers and all. So, would you mind if you have a quick look through the code, I dont know what that http://www.swansoninternet.com/phpincludes/$output is for, but looking at the whole line, I certainly havent seen any image I uploaded show on the page... Help is much appreciated!, thanks! <?php // Where the file is going to be placed $target_path = "/icons/"; /* Add the original filename to our target path. Result is "/icons/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); $_FILES['uploadedfile']['tmp_name']; // If we have uploaded correctly... $extensions = array("JPG","jpg","JPEG","jpeg"); //File Types $check = $target_path; $explosion = explode(".", $check); $name = $explosion[0]; //This is the real name of the file $extension = $explosion[1]; //This is the extension of the full file if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { if (!in_array($extension, $extensions)) { echo "You have to upload a file ending in .jpg in order for us to generate your favicon"; unlink ($target_path); // delete the original file } else { echo "We have successfully generated your icon!<Br>"; // Now actually generate it $im = imagecreatefromjpeg($target_path); list($width, $height) = getimagesize($target_path); // get the width and height of the jpg $image_p = imagecreatetruecolor("16", "16"); // create a 16x16 canvas to play with imagecopyresampled($image_p, $im, 0, 0, 0, 0, "16", "16", $width, $height); // resize jpg to 16x16 $num = rand (1,99999); // generate a random number between 1 and 99999 $output = $num."-favicon.ico"; // add the number to a string with -favicon.ico imagepng($image_p,$output); // make a .png file (icon file) from our data imagedestroy ($im); // close gd library echo "<img src = \"http://www.swansoninternet.com/phpincludes/$output\"><br>Right click on the image and choose save. Save the image as favicon.ico and then upload into your base directory"; // show our icon with information unlink ($target_path); // delete the original file } } else{ echo "Upload a .jpg file to convert it to a favicon!"; } ?> <title>Favicon Generator</title> <style type="text/css"> <!-- body,td,th { font-family: Tahoma, Helvetica, sans-serif; font-size: small; color: #666666; } --> </style><form enctype="multipart/form-data" action="<?php $_SERVER['PHP_SELF']; ?>" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Create Favicon" /> </form>
  4. im not entirely sure tbh, here is what that is on the database "<p>Welcome!</p>"
  5. BEFORE PARSE Welcome! AFTER PARSE <p>Welcome!</p>
  6. UPDATE article_content SET title='Welcome to Eagle Legend!' WHERE page='index' UPDATE article_content SET content=' Welcome! ' WHERE page='index' UPDATE article_content SET date='2009 03 05' WHERE page='index' Please be aware I left your "htmlspecialchars_decode" in it
  7. the same echo as before?
  8. No I havent typed it in myself actually... it was the java text box thing, basically I typed something and pressend enter - new paragraph, although it dont show the code, but it shows what it will look like... so I guess it would be that that does that then?
  9. So what do you suggest I do then?
  10. index.php <?php // Easy Adoptables Script by Brandon Rusnak // Get our includes out of the way include("inc/functions.php"); include("inc/config.php"); include("inc/settings.php"); include("inc/nbbc.php"); // BBCODE Parser $bbcode = new BBCode; // Connect to our database $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql database!'); mysql_select_db($dbname); //Set up our login info... $username = ""; $password = ""; //Check for cookie if (isset($_COOKIE['adoptu']) and isset($_COOKIE['adoptp'])){ $username = $_COOKIE['adoptu']; $password = $_COOKIE['adoptp']; $username = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $username); $password = preg_replace("/[^a-zA-Z0-9s]/", "", $password); //Run login operation $query = "SELECT * FROM users WHERE username = '$username'"; $result = mysql_query($query); $num = mysql_numrows($result); //Loop out code $i=0; while ($i < 1) { $luser=@mysql_result($result,$i,"username"); $lpass=@mysql_result($result,$i,"password"); $i++; } if($username == $luser and $password == $lpass){ $isloggedin = "yes"; } else{ if (isset($_COOKIE['adoptu'])){ $past = time() - 10; setcookie("adoptu",$username,$past); } if (isset($_COOKIE['adoptp'])){ $past = time() - 10; setcookie("adoptp",$password,$past); } $isloggedin = "no"; } } else { //User is not logged in $isloggedin = "no"; } // Define our Template File $file = $current_theme; // Get our content for the index page $query = "SELECT * FROM article_content WHERE page = 'index'"; $result = mysql_query($query); $num = mysql_numrows($result); //Loop out code $i=0; while ($i < 1) { $article_title=mysql_result($result,$i,"title"); $article_date=mysql_result($result,$i,"date"); $article_content=mysql_result($result,$i,"content"); $i++; } $article_title = stripslashes($article_title); $article_content = stripslashes($article_content); $article_content = $bbcode->Parse($article_content); // Run the BBCODE parser on the content // Should we show the extra pages in the nav bar? $link1 = ""; if($show_extra_page1 == "yes"){ $link1 = "<a href='$extra_page1_link'>$extra_page1_name</a>"; } $link2 = ""; if($show_extra_page2 == "yes"){ $link2 = "<a href='$extra_page2_link'>$extra_page2_name</a>"; } // Do the template changes and echo the ready template $template = file_get_contents($file); $template = replace(':SITETITLE:',$site_title,$template); $template = replace(':SITENAME:',$site_name,$template); $template = replace(':ARTICLETITLE:',$article_title,$template); $template = replace(':ARTICLEDATE:',$article_date,$template); $template = replace(':ARTICLECONTENT:',$article_content,$template); $template = replace(':LINK1:',$link1,$template); $template = replace(':LINK2:',$link2,$template); $template = replace(':LINK3:',$link3,$template); //Get the featured adoptable... $featured = getfeatured(); $template = replace(':FEATURED:',$featured,$template); //Ad Management $header = @file_get_contents("ads/header.txt"); $footer = @file_get_contents("ads/footer.txt"); $tower = "<h2>Advertisement</h2>"; $tower = @file_get_contents("ads/tower.txt"); $header = stripslashes($header); $footer = stripslashes($footer); $tower = stripslashes($tower); $template = replace(':HEADERAD:',$header,$template); $template = replace(':FOOTERAD:',$footer,$template); $template = replace(':TOWERAD:',$tower,$template); //Is the user logged in? //$isloggedin = "no"; if ($isloggedin == "yes"){ $template = replace(':WELCOMEORREGISTER:','<u>Welcome Back:</u>',$template); $template = replace(':LOGINORACCT:', 'Welcome back '.$username.'. <br><br><a href="account.php">Click here to view or edit your account.</a><br><br><a href="logout.php">Log Out</a>' ,$template); } else{ //User is not logged in $template = replace(':WELCOMEORREGISTER:','<u>Member Login:</u>',$template); $loginform = "<form name='form1' method='post' action='login.php'> <p>Username: <input name='username' type='text' id='username'> </p> <p>Password: <input name='password' type='password' id='password'> </p> <p> <input type='submit' name='Submit' value='Submit'> </p> <p>Don't have an account?<br> <a href='register.php'>Register Free</a> </p> </form> "; $template = replace(':LOGINORACCT:', $loginform ,$template); } echo $template; ?>
  11. hmm... strange, that hasnt stopped the paragraph tags appearing... http://www.eaglelegend.com/index.php
  12. Sorry - I know I have asked enough of you up to now, sorry, how do I do this? - hopefully this should be the last thing LOL, thanks for everything so far though, you have been very helpful, you have helped kickstart my sites code LOL!
  13. cheers!, were getting there! http://www.eaglelegend.com/index.php though it is now submitting the code too it seems, note the paragraph code next to it...
  14. So any ideas, was I right about the pages thing? do you know a possible fix for it?
  15. OK, this is what I got from your test... UPDATE article_content SET title='Welcome to Eagle Legend!' WHERE page='page' UPDATE article_content SET content=' Testing Page ' WHERE page='page' UPDATE article_content SET date='2009 03 05' WHERE page='page'
  16. oh right, I just quickly put the echo in the "completed" bit, and I put in the echo bit. and this is what I got - "page page, title Welcome to Eagle Legend!, content: test 123 - testing the content" however I think "page should be index I think... or at least the page im editing
  17. remind me how do I echo again please? was it echo $article_content and where do I echo it?
  18. I still don't understand what I must do to fix this issue of getting what I have typed in to go straight into the database... where its supposed to be going...
  19. hmm... I thought pages.php was the form?...
  20. I believe, the below page (modifypage.php) is the file which sends the information to the database... What I dont understand now is why nothing is going in now :/ <?php session_start(); include ("../inc/config.php"); if(isset($_SESSION['password'])){ if ($_SESSION['password'] != $apass){ session_destroy(); die ("Hacking Attempt!"); } } else { die("Hacking Attempt!"); } //Let's output the website listing //First connect to the DB $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ("Cannot Connect to Database"); mysql_select_db($dbname); //Get the input $page = $_POST["page"]; $title = $_POST["title"]; $content = $_POST["content"]; //Clean our input $page = preg_replace("/[^a-zA-Z0-9s]/", "", $page); $title = mysql_real_escape_string($title); $content = mysql_real_escape_string($content); //Make sure input isn't blank if ($title == "" or $content == ""){ include "header.php"; echo "<h2>Error</h2>"; echo "Your title or content is blank. This is not allowed. Please <a href='pages.php?page=".$page."'>go back</a> and correct this."; include "footer.php"; die(); } $query = "UPDATE article_content SET title='".$title."' WHERE page='".$page."'"; mysql_query($query); $query = "UPDATE article_content SET content='".$content."' WHERE page='".$page."'"; mysql_query($query); $date = date('Y m d'); $query = "UPDATE article_content SET date='".$date."' WHERE page='".$page."'"; mysql_query($query); include "header.php"; echo "<h2>Completed</h2>"; echo "Done! Your page has been updated! <a href='pages.php'>Go back to the page editor.</a>"; include "footer.php"; ?>
  21. Thanks Keith, after entering test into the textbox, it gave me this "Completed Done! Your page has been updated! Go back to the page editor." - thats a good thing, however it hasnt inputted the information to the database
  22. george - after your mod same thing came up scot - what did you mean by error handler?, where?
  23. this is where the form is located on this form - pages.php <?php session_start(); include ("../inc/config.php"); if(isset($_SESSION['password'])){ if ($_SESSION['password'] != $apass){ session_destroy(); die ("Hacking Attempt!"); } } else { die("Hacking Attempt!"); } //Let's output the website listing //First connect to the DB $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ("Cannot Connect to Database"); mysql_select_db($dbname); //Now we can get the page $page = $_GET['page']; $page = preg_replace("/[^a-zA-Z0-9s]/", "", $page); if($page == "" or $page == NULL){ include "header.php"; echo " <h2>Editting Pages (LIST)</h2> <p><u><strong>Please choose a page to edit the content:</strong></u></p> <p><a href='pages.php?page=index'>Index Page</a><br> <a href='pages.php?page=tos'>Terms of Service Page</a><br> <a href='pages.php?page=extra'>Extra Page</a></p> "; include "footer.php"; } else if($page == "index" || $page == "tos" || $page == "extra"){ // We are editing a page $query = "SELECT * FROM article_content WHERE page = '".$page."'"; $result = mysql_query($query); $num = mysql_numrows($result); //Loop out code $i=0; while ($i < 1) { $article_title=mysql_result($result,$i,"title"); $article_date=mysql_result($result,$i,"date"); $article_content=mysql_result($result,$i,"content"); $i++; } $article_title = stripslashes($article_title); $article_content = stripslashes($article_content); include "header.php"; echo " <h2>Edit Page (".$page.")</h2> <p><u><strong>Page Editor:</strong></u></p> <p><strong>You are editing page: ".$page."</strong> (<a href='pages.php'>Change Page</a>) </p> <form name='form1' method='post' action='modifypage.php'> <p><u>Page Title:</u></p> <p> <input name='title' type='text' id='title' value='".$article_title."'> </p> <p><u>Page Content:</u></p> <p>"; ?> <script type="text/javascript" src="tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager", // Theme options theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|fontselect,fontsizeselect,|,forecolor,backcolor", theme_advanced_buttons2 : "search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview", theme_advanced_buttons3 : "moveforward,movebackward,absolute,|,styleprops,spellchecker,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage,|,hr,|,sub,sup,|,charmap,emotions,advhr,|,ltr,rtl", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Drop lists for link/image/media/template dialogs template_external_list_url : "js/template_list.js", external_link_list_url : "js/link_list.js", external_image_list_url : "js/image_list.js", media_external_list_url : "js/media_list.js", }); </script> <textarea width="100%"> <?php echo "$article_content </textarea> <input name='page' type='hidden' id='page' value='".$page."'> </p> <p> <input type='submit' name='Submit' value='Submit'> </p> </form> <p>You can use BBCODE in the editor. </p> "; include "footer.php"; } else { die("You did not enter in a valid page. Please go back and try again."); } ?>
  24. hey i get this when i enter information and submit... Error Your title or content is blank. This is not allowed. Please go back and correct this. here is the code of the page im submitting it from... <?php session_start(); include ("../inc/config.php"); if(isset($_SESSION['password'])){ if ($_SESSION['password'] != $apass){ session_destroy(); die ("Hacking Attempt!"); } } else { die("Hacking Attempt!"); } //Let's output the website listing //First connect to the DB $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ("Cannot Connect to Database"); mysql_select_db($dbname); //Get the input $page = $_POST["page"]; $title = $_POST["title"]; $content = $_POST["content"]; //Clean our input $page = preg_replace("/[^a-zA-Z0-9s]/", "", $page); $title = mysql_real_escape_string($title); $content = mysql_real_escape_string($content); //Make sure input isn't blank if ($title == "" or $content == ""){ include "header.php"; echo "<h2>Error</h2>"; echo "Your title or content is blank. This is not allowed. Please <a href='pages.php?page=".$page."'>go back</a> and correct this."; include "footer.php"; die(); } $query = "UPDATE article_content SET title='".$title."' WHERE page='".$page."'"; mysql_query($query); $query = "UPDATE article_content SET content='".$content."' WHERE page='".$page."'"; mysql_query($query); $date = date('Y m d'); $query = "UPDATE article_content SET date='".$date."' WHERE page='".$page."'"; mysql_query($query); include "header.php"; echo "<h2>Completed</h2>"; echo "Done! Your page has been updated! <a href='pages.php'>Go back to the page editor.</a>"; include "footer.php"; ?> I really dont understand whats going on, if you can help that would be great! thanks in advance
×
×
  • 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.