Jump to content

ZulfadlyAshBurn

Members
  • Posts

    783
  • Joined

  • Last visited

Everything posted by ZulfadlyAshBurn

  1. what the the country you are in?
  2. II7? that means you have II7 installed. the folder is usually at the local drive.
  3. I setup my server using the original apache installer. you may want to use XAMPP 1.7.4
  4. you must setup the php.ini and http.conf
  5. ok, sorry. please mark topic as solved
  6. no prob its my honour to help people
  7. use date_default_timezone_set();
  8. haha. no prob its my honour to help peeple
  9. you can google it if you want mark topic as solve
  10. add another else. <? $error = ""; $pass = ($_POST['pass']); if(!$pass) { $error .= "Please enter your password! "; } if($error){ echo "<div align='center'><h2>Error!</h2><>"; echo "<div align='center'>\n<p>$error</p><>"; echo "<div align='center'>\n<>"; echo "<div align='center'>\n<p><a href='$HTTP_REFERER'>Return and try again</a></p><>"; } else { if (!$error && $pass == 'test'); { $fn = "../../scripts/tabs_index/pages/news.html"; $content = stripslashes($_POST['content']); $fp = fopen($fn,"w") or die ("Error opening file in write mode!"); fputs($fp,$content); fclose($fp) or die ("Error closing file!"); echo "<div align='center'><h2>Change Successful!</h2><>"; echo "<div align='center'>\n <p>News has been successfully changed and is now live!</p><>"; echo "<div align='center'>\n---------------------------------------------------------------<>"; echo "<meta http-equiv=\"refresh\" content=\"3; url=http://xxxxxxxxxxx/account=administrator\" />\n"; } else { $error .= "Wrong Password!"; echo "<div align='center'><h2>Error!</h2><>"; echo "<div align='center'>\n<p>$error</p><>"; echo "<div align='center'>\n<>"; echo "<div align='center'>\n<p><a href='$HTTP_REFERER'>Return and try again</a></p><>"; } } ?>
  11. you may want to have the $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $dbdata = 'accounts'; in another file named connDB.php then make it require from your config.php thus the config, connDB & editer page would look like this. config.php <?php require("connDB.php"); $connection = mysql_connect($dbhost, $dbuser, $dbpass) or die ("Could not connect to server ... \n" . mysql_error ()); mysql_select_db($dbdata) or die ("Could not connect to database ... \n" . mysql_error ()); ?> connDB.php <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $dbdata = 'accounts'; ?> then on editer.php <?php // check if user edited the page. if(isset($_REQUEST['editfile'])) { $editfile = $_REQUEST['editfile']; $filename = "includes/connDB.php"; $handle = fopen($filename, "w+"); fwrite($handle, $editfile); fclose($handle); echo "Done Editing!"; } // if not show the form else { $self = $_SERVER['PHP_SELF']; echo "<form action='" .$self. "' method='post'/><textarea name='editfile' rows='20' cols='50'>"; $filename = "includes/connDB.php"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); echo $contents; fclose($handle); echo "</textarea><input type='submit' value='Submit'/></form>"; } ?> its much simpler
  12. sorry, my bad. so you just want the user to edit the db part?
  13. copy the font type from your computer and upload it to your server. can be done using css3 @font-face { font-family: fontname; src: url('fontname.ttf'); } .my_CSS3_class { font-family: fontname; font-size: 3.2em; } change fontname to the actual font name
  14. opps. sorry. i forget to change the save point to includes/config.php // check if user edited the page. if(isset($_REQUEST['editfile'])) { $editfile = $_REQUEST['editfile']; $filename = "includes/config.php.php"; $handle = fopen($filename, "w+"); fwrite($handle, $editfile); fclose($handle); echo "Done Editing!"; } // if not show the form else { $self = $_SERVER['PHP_SELF']; echo "<form action='" .$self. "' method='post'/><textarea name='editfile' rows='20' cols='50'>"; $filename = "includes/config.php"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); echo $contents; fclose($handle); echo "</textarea><input type='submit' value='Submit'/></form>"; } it should work now
  15. use else. <? $error = ""; $pass = ($_POST['pass']); if(!$pass) { $error .= "Please enter your password! "; } if($error){ echo "<div align='center'><h2>Error!</h2></div>"; echo "<div align='center'>\n<p>$error</p></div>"; echo "<div align='center'>\n</div>"; echo "<div align='center'>\n<p><a href='$HTTP_REFERER'>Return and try again</a></p></div>"; } else { if (!$error && $pass == 'test'); { $fn = "../../scripts/tabs_index/pages/news.html"; $content = stripslashes($_POST['content']); $fp = fopen($fn,"w") or die ("Error opening file in write mode!"); fputs($fp,$content); fclose($fp) or die ("Error closing file!"); echo "<div align='center'><h2>Change Successful!</h2></div>"; echo "<div align='center'>\n <p>News has been successfully changed and is now live!</p></div>"; echo "<div align='center'>\n---------------------------------------------------------------</div>"; echo "<meta http-equiv=\"refresh\" content=\"3; url=http://xxxxxxxxxxx/account=administrator\" />\n"; } } ?> use that code. i've edited it for you.
  16. this is how you are gonna have it done. use this exact code. // check if user edited the page. if(isset($_REQUEST['editfile'])) { $editfile = $_REQUEST['editfile']; $filename = "r.php"; $handle = fopen($filename, "w+"); fwrite($handle, $editfile); fclose($handle); echo "Done Editing!"; } // if not show the form else { $self = $_SERVER['PHP_SELF']; echo "<form action='" .$self. "' method='post'/><textarea name='editfile' rows='20' cols='50'>"; $filename = "includes/config.php"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); echo $contents; fclose($handle); echo "</textarea><input type='submit' value='Submit'/></form>"; }
  17. oh lol. do you even have a page which is edit.php?
  18. its works pretty well on my local server o.0 make sure that the apostrophes are correct?
  19. you may want to try this. echo "<form action='edit.php' method='POST'><textarea name='editpage'>"; $filename = "index.php"; // replace to actual file name $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); echo $contents; fclose($handle); echo "</textarea><input type='submit' value='Submit'/></form>"; that will place everything in the file into a textarea which is in a form the will pass the data to edit.php
  20. you may want to use fopen to open the file?
  21. anyway, did you use my code? $strLink = "<a href='viewTicket.php?id=" .$row['id']. "'>" .$strName. "</a>"; and it looks like you are using mySql for the $row[]
  22. anton_1, are you trying to use the $strLink = "<a href='viewTicket.php?id={$row['id']}' class='simpledialog'>$strName</a>"; to fade in an id called box? you are already using the href to link it to another page thus the simpledialog function cannot be used.
  23. so is it allowed or not?
  24. I started to love programming when I was in a games creation competition. I was force by my school to join the competition. I was reluctant to join the competition. Then I have this friend from my school who was super extreme in AS scripting. From there, I started to love coding. He thought me the basic of AS scripting. After a few days, I was telling myself, how is a website build. I went to Google and search. They told me, programming. So i went to the library and search some books about programming. There, I learn the basic of Html and JavaScript. I went on further by trying to learn how people are logged in to sites. Initially, I used JavaScript to code how people would logged in to my site, then I realised that they are able to see the username and password by view source. I tried to disabled view source by JavaScript but it was easy to crack. Then again, I Googled website login script and a new language came to me, PHP & MySQL. There, I started building my login page and members restricted area. I also picked up jQuery and python. I learn ajax when my site requires the login to be done without reloading and it was great. The reason why I love programming is because I have the passion to do it. Every single day, I have to program something. Its like a drug. And thanks to phpfreaks forum, I am able to fix my code asap
×
×
  • 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.