Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. i just reviewed the code and the page your getting is correct, by the logic you have.. what was you expecting to have displayed ?
  2. echo $ip; to check what ip is being used then check in the database
  3. if ($_POST['password']==$adpass || $_SESSION['Access'] ) ( should be if ($_POST['password']==$adpass || $_SESSION['Access'] ) {
  4. zip failed
  5. you need <?php session_start(); ?> at the very top of the page
  6. well as i said php is server side, so your more likely to use it with forms heres a nice starting point http://www.w3schools.com/PHP/default.asp forms http://www.w3schools.com/PHP/php_forms.asp then read the PHP Database from that point to should get the good basic idea, just remember php is more for the use of data then look and feel of it, i would recommend that you get phpmyadmin aka PMA (a web based mysql tool), use PMA to create a database and a table with a few fields first name, last name etc, then build a basic form and with the same data name, last name etc, and get that data to be INSERTed into the table after that write another page to list all records and build up from their
  7. on your upload page you probably check for the password ie ($_POST['password']==$adpass ) just add || $_SESSION['Access'] makes it ($_POST['password']==$adpass || $_SESSION['Access']) try that if it failes post the upload php file
  8. i am not going to do it for you (you need to show some effort) but your need an input text box and some text, if the input name is "question" then your php validation code would be if( strtolower($_POST['question']) != "hot" ) { echo "wrong"; }
  9. Yeah i agree its not likely to be your IE6, anyways, try this <?php if(!empty($_POST['uname']) && !empty($_POST['upass'])) { session_start(); $_SESSION['uname'] = strtolower($_POST['uname']); $_SESSION['upass'] = $_POST['upass']; header('location: main_admin.php'); exit(); } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Can You Come? Content Manager</title> <link href="assets/cpstyleslogin.css" rel="stylesheet" type="text/css" /> </head> <body id="cmhomepage"> <div id="wrapper"> <div id="header"></div> <div id="subheader">Content Manager</div> <div id="pagetitle">Login</div> <div id="content"> <div id="rightcolumn"><form action="logadm.php" method="post" > <table width="300" align="center" cellpadding="5" cellspacing="5"> <tr> <td class="rowBody">Username: <td><input type=text name="uname"> <tr> <td class="rowBody">Password: <td><input type=password name="upass"> <tr> <td colspan=2 align=center> <div align="center"> <input type=submit value="Login" size=20 class="button"> </table> </form> </div> </div> <div id="footer"> <?php include("footer.php"); ?> </div> </div> </body> </html> EDIT: revised to make is easier to edit later
  10. $handlef1 = fopen($f1, 'w'); fwrite($handlef1, $friend1); fclose($f1);<--Add
  11. had typos clean version (should be ok) <?php session_start(); ?> <html> <head> <title>upload form</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript"> function pre() { form2.preview.src = 'thumbnails/image'+form2.choiceimage.options[form2.choiceimage.selectedIndex].value+'.jpg'; } </script> </head> <body bgcolor="#000000" text="#CCCCCC" link="#FF3300" vlink="#FF3300"> <div align="center"><font color="#FF3300" face="Arial, Helvetica, sans-serif"><strong>GALLERY ADMIN PAGE</strong></font><br> </div> <?php include("config.inc"); if ($_POST['password']==$adpass || $_SESSION['Access'] ) { $_SESSION['Access'] = true; if ($_POST['submit']=="Edit") { echo "<script language='JavaScript'> window.location = 'uploadform.php?i=$choiceimage&password=$password'; </script>"; }elseif ($_POST['submit']=="Delete") { for ($i=1; file_exists("images/image".strval($i).".jpg"); $i++) { } $num=$i-1; if (!del($choiceimage)) echo "Error"; for ($i=intval($choiceimage)+1; $i<$num; $i--) { $j=$i-1; if (!rename("images/image$i.jpg", "images/image$j.jpg")) $error="r"; } if ($error=="") echo "Image$choiceimage deleted successfully"; } else { echo "<form name=\"form2\" action=\"$PHP_SELF\" method=\"post\"> <p align=\"center\"><font color=\"#CCCCCC\" size=\"1\" face=\"verdana\"><strong><font size=\"2\">Upload New Picture</font></strong></font></p> <p align=\"center\"><strong><font color=\"#CCCCCC\" size=\"1\" face=\"verdana\"><a href=\"uploadform.php?password=$password\">click here</a> </font></strong></p> <p align=\"center\"><strong><font color=\"#CCCCCC\" size=\"1\" face=\"verdana\">OR</font></strong></p> <p align=\"center\"><strong><font color=\"#CCCCCC\" size=\"1\" face=\"verdana\"><strong><font size=\"2\">EDIT Existing Picture</font></strong></font></strong></p> <p align=\"center\"><font color=\"#CCCCCC\" size=\"1\" face=\"verdana\"><strong>Image Select :<br> <table border=0><tr><td><select name=\"choiceimage\" size=10 onChange=\"pre()\">"; for ($i=1; file_exists("thumbnails/image".strval($i).".jpg"); $i++) { echo "<option value=$i>Image$i</option>"; } echo "</select></td> </strong></font></p> <p align=center> <td><img src=\"noth.gif\" border=0 name=preview></td></p></tr></table> <p align=\"center\"><strong><font color=\"#CCCCCC\" size=\"1\" face=\"verdana\"> <input type=\"submit\" name=\"submit\" value=\"Edit\"> <input type=\"hidden\" name=\"password\" value=\"$password\"> <input type=\"submit\" name=\"submit\" value=\"Delete\"> </font></strong> </p> </form>"; } } else echo "<form name=\"form1\" action=\"$PHP_SELF\" method=\"post\">Password : <input type=\"password\" name=\"password\" size=20> <input type=submit name=submit value=OK> </form>"; ?> <div align="center"><br><font color="#CCCCCC" size="1" face="verdana"><a href="index.php">Go To Gallery</a><br> <br>©Kyscorp.tk -2000-2003- Kys Gallery 1.0 </font></div> <style> BODY { scrollbar-face-color: "#000000"; scrollbar-arrow-color: "#000000"; scrollbar-track-color: "#000000"; scrollbar-3dlight-color:"#333333"; scrollbar-darkshadow-color: "#333333"; } </style></body> </html> <?php function unlinkk($f) { if (!file_exists($f)) return true; else return unlink($f); } function del($i) { if (unlinkk("images/image$i.jpg") and unlinkk("thumbnails/image$i.jpg") and unlinkk("down/image$i.zip") and unlinkk("des/image$i.txt")) return true; } ?>
  12. okay first thing.. PHP is server side scripting.. this means you can call a function like you would in JS, if you need to do that your need JS to interact with php via a get/post request (see AJAX) now to use the URL ie index.php?page=home you could do this <?php $page = (!empty($_GET['page']))?strtolower($_GET['page']):""; switch($page) { default: case "home": include "home.php"; break; case "contact": include "contact.php"; break; case "about": include "about.php"; break; } ?> what the above does is get the page from the URL ie home; then we convert to lowercase (makes life easier), then we could use alot of if's but i'm going to use switch, it then checks if page = home, contact or about, then includes that page ie home.php i could do this $page = (!empty($_GET['page']))?strtolower($_GET['page']):"home"; include "$page.php"; but that gives too much control away (secuirty risk) i hope that helps you get started
  13. Try this <?php session_start(); ?> <html> <head> <title>upload form</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript"> function pre() { form2.preview.src = 'thumbnails/image'+form2.choiceimage.options[form2.choiceimage.selectedIndex].value+'.jpg'; } </script> </head> <body bgcolor="#000000" text="#CCCCCC" link="#FF3300" vlink="#FF3300"> <div align="center"><font color="#FF3300" face="Arial, Helvetica, sans-serif"><strong>GALLERY ADMIN PAGE</strong></font><br> </div> <?php include("config.inc"); if ($_POST['password']==$adpass || $_SESSION=['Access'] ) { $_SESSION=['Access'] = true; if ($_POST['submit']=="Edit") { echo "<script language='JavaScript'> window.location = 'uploadform.php?i=$choiceimage&password=$password'; </script>"; }elseif ($_POST['submit']=="Delete") { for ($i=1; file_exists("images/image".strval($i).".jpg"); $i++) { } $num=$i-1; function unlinkk($f) { if (!file_exists($f)) return true; else return unlink($f); } function del($i) { if (unlinkk("images/image$i.jpg") and unlinkk("thumbnails/image$i.jpg") and unlinkk("down/image$i.zip") and unlinkk("des/image$i.txt")) return true; } if (!del($choiceimage)) echo "Error"; for ($i=intval($choiceimage)+1; $i<$num; $i--) { $j=$i-1; if (!rename("images/image$i.jpg", "images/image$j.jpg")) $error="r"; } if ($error=="") echo "Image$choiceimage deleted successfully"; } else { echo "<form name=\"form2\" action=\"$PHP_SELF\" method=\"post\"> <p align=\"center\"><font color=\"#CCCCCC\" size=\"1\" face=\"verdana\"><strong><font size=\"2\">Upload New Picture</font></strong></font></p> <p align=\"center\"><strong><font color=\"#CCCCCC\" size=\"1\" face=\"verdana\"><a href=\"uploadform.php?password=$password\">click here</a> </font></strong></p> <p align=\"center\"><strong><font color=\"#CCCCCC\" size=\"1\" face=\"verdana\">OR</font></strong></p> <p align=\"center\"><strong><font color=\"#CCCCCC\" size=\"1\" face=\"verdana\"><strong><font size=\"2\">EDIT Existing Picture</font></strong></font></strong></p> <p align=\"center\"><font color=\"#CCCCCC\" size=\"1\" face=\"verdana\"><strong>Image Select :<br> <table border=0><tr><td><select name=\"choiceimage\" size=10 onChange=\"pre()\">"; for ($i=1; file_exists("thumbnails/image".strval($i).".jpg"); $i++) { echo "<option value=$i>Image$i</option>"; } echo "</select></td> </strong></font></p> <p align=center> <td><img src=\"noth.gif\" border=0 name=preview></td></p></tr></table> <p align=\"center\"><strong><font color=\"#CCCCCC\" size=\"1\" face=\"verdana\"> <input type=\"submit\" name=\"submit\" value=\"Edit\"> <input type=\"hidden\" name=\"password\" value=\"$password\"> <input type=\"submit\" name=\"submit\" value=\"Delete\"> </font></strong> </p> </form>"; } } else echo "<form name=\"form1\" action=\"$PHP_SELF\" method=\"post\">Password : <input type=\"password\" name=\"password\" size=20> <input type=submit name=submit value=OK> </form>"; ?> <div align="center"><br><font color="#CCCCCC" size="1" face="verdana"><a href="index.php">Go To Gallery</a><br> <br>©Kyscorp.tk -2000-2003- Kys Gallery 1.0 </font></div> <style> BODY { scrollbar-face-color: "#000000"; scrollbar-arrow-color: "#000000"; scrollbar-track-color: "#000000"; scrollbar-3dlight-color:"#333333"; scrollbar-darkshadow-color: "#333333"; } </style></body> </html>
  14. personally i would used textarea, and POST, also your not closing the files. but then again you haven't said what the problem is.
  15. the reason for this forum is to allow people to search for solutions and request help with their code, as your code is open source it would probably be better to post in the third party section the fact you want to do the whole thing via email means no one except you benifit from it, which isn't going to help others so you can either get help via public post or private help freelance section.
  16. true but it was an example of the problem with the quotes
  17. sounds like your missing a \" after target eg (this would cause the same problem) <form action=\"$PHP_SELF method=\"post\" should be <form action=\"$PHP_SELF\" method=\"post\"
  18. we are all happy to help but we get tons of people wanting us to code for free, when we offer free help if you put some effort in and get something going in the right direction i'm sure we can help you the rest of the way.
  19. thats why i said try this $from = "From: YourName <myemail@mydomain.com>\r\nReply-To: myGMAIL@gmail.com\r\n"; note the "myGMAIL@gmail.com" can be any email and when they reply it will go their so it sends from the freehostia but they will reply to the gmail one
  20. from last script on 2nd to last post change }elseif ($submit=="Delete") { to }elseif ($_POST['submit']=="Delete") { on the last post change if ($password==$adpass) { if ($action=="save") { to if ($_POST['password']==$adpass) { if ($_POST['action']=="save") { and $name=stripslashes($name); $des=stripslashes($des); $code=stripslashes($code); $author=stripslashes($author); to $name=stripslashes($_POST['name']); $des=stripslashes($_POST['des']); $code=stripslashes($_POST['code']); $author=stripslashes($_POST['author']); theirs 2 of the above i think thats all
  21. if you have $from = 'From: YourName <myemail@mydomain.com>'; on the clients email app it will show YourName as whos it from but if you reply it goes to myemail@mydomain.com, when you setup your hosting account they should give you all the details to setup your email on your own email app (ie outlook) you could try <?php $from = "From: YourName <myemail@mydomain.com>\r\nReply-To: myGMAIL@gmail.com\r\n"; $to = 'support@freehostia.com'; //change to you freehostia email address $subject = 'Subject'; $body = 'TEST'; if (mail ($to, $subject, $body, $from)) { echo 'MAIL - OK'; } else { echo 'MAIL FAILED'; } ?>
  22. Another wish list, but i won't email you it I want £8,000,000 but i don't think want one will just give it to me.. we won't write the code for you unless you post in the freelance section and off something in exchange ie payment, but you could try google,
  23. i agree change if ($password==$adpass) { if ($submit=="Edit") { to if ($_POST['password']==$adpass) { if ($_POST['submit']=="Edit") { if you wanted to cheat (not recommended) but you could do this extract($_POST); //ADD this line if ($password==$adpass) { if ($submit=="Edit") {
  24. your probably need to open a ticket with FreeHostia, they seams to have a ton members with email problems see here
  25. your sending FROM a gmail account , thus you need your gmail password, if your not sending from a gmail account your need to check the your POP & SMTP setup in the php.ini file, to check they are your correct email server settings
×
×
  • 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.