Jump to content

blesseld

Members
  • Posts

    90
  • Joined

  • Last visited

    Never

Everything posted by blesseld

  1. Hey All, I will be marketing a simple php script shortly and would like to Obfuscate my code and have it check to see if the person is running the script on the proper domain, much like other Purchased Scripts, you have to buy licenses and some are limited to a Per Domain basis. Could I use cURL to run a script on another server (mine) that takes the URL it came from, and a variable "the auth key" and check if the person is using the script on the proper domain? If the domain and auth key don't match in the DB i would return a message saying invalid key or something, else continue to execute the script. <?php //authkey would be defined in config file $authkey = "769870afhljkzxf90436"; $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,"http://example.com/page.php?authkey=$authkey"); curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2); curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1); $buffer = curl_exec($curl_handle); curl_close($curl_handle); if (empty($buffer)) { print "Sorry, AuthServ is performing maintenance.....<p>"; } else { print $buffer; } ?> Is there a smarter way to do this? I don't have an extra 300 bucks to use something like ioncube, just looking for a general proper direction on going about this as I am totally clueless. thanks
  2. ...why is it always so hard here to get an answer? I am seeking a solution. I see this all over the place where you have to buy a license...that's all I am trying to achieve. I have a config file, with like 3 lines, and I tell them what to put in there with videos on setting up the database.... so ya the basic user that only knows how to setup the script based on the way I show them. What do you "experts" suggest I do.... am I better off just buying something, Or can I use encoding or obfuscation plus something that contents to my server/hit a page that runs a script and checks for something. If the guy that knows php wants to steal it, they are going to regardless.
  3. Thanks for the reply, and link I understand that the call back could be cut out, can I not have the script hit a page on my server that connects to a db with stored domain and auth key info? then if it doesn't match to what the user put in return the the auth key is invalid? I am catering to the basic user and not programmer...if a programmer really wants what I am offering they could probably get around whatever to get this thing to work on other domains.
  4. Hey All, I am looking for a way to setup licensing for a script i built, I am not to worried about the script being modified because I will have different tutorials on modifying things within the script, but I would like to restrict the use of the script to a Per Domain basis. I am looking for some resources or a foot in the right direction to achieve this. Basically, I am looking to setup an authentication code linked to a domain name. The user uploads the script, adds user/pass/authentication code. Are callbacks a way for me to setup a database with this info, and if the code doesn't match the domain it's not usable? perhaps by including an important file or command... thanks in advance for any info.
  5. This is what should end up in the file <?php $page_num = "1"; $pathtometa = $_SERVER["DOCUMENT_ROOT"].'/inc/meta.php'; include ("$pathtometa"); include ("$var/global-control.php"); include ("$var/page.php"); ?> domain.com/index.php the users are beginners and people that don't know any code...let alone setup a database... so the idea is to build a create page feature so they don't have to create new files and copy the code above, of course they would need to change the page number save the file then upload to the server domain.com/about.php <--page num = 2 <?php $page_num = "2"; $pathtometa = $_SERVER["DOCUMENT_ROOT"].'/inc/meta.php'; include ("$pathtometa"); include ("$var/global-control.php"); include ("$var/page.php"); ?> Here is the first page <?php if ($loggedin) { echo <<< _END <div class="clear"></div> <form method="post" action="admin-create-page-1.php"> <ul class="edit-form"> <li><label class="label">Title</label><br /><input class="text" type='text' maxlength='300' name='createcontent' value='$createcontent' /></li> <li><label class="label">Title</label><br /><input class="text" type='text' maxlength='300' name='createcontent1' value='$createcontent1' /></li> <li><label class="label">Title</label><br /><input class="text" type='text' maxlength='300' name='createcontent2' value='$createcontent2' /></li> <li><label class="label">Title</label><br /><input class="text" type='text' maxlength='300' name='createcontent3' value='$createcontent3' /></li> <li><label class="label">Title</label><br /><input class="text" type='text' maxlength='300' name='createcontent4' value='$createcontent4' /></li> </ul> <ul class="edit-form"> <li class="edit-form-submit"><input src="../themes/theme-admin/default-admin-template/images/meta-submit.jpg" type='image' value='createpage' name='createpage' /></li> </ul> </form> _END; } else header("Location: $admin_redirect"); die(""); ?> second page <?php if ($loggedin) { $createcontent = stripslashes($_POST['createcontent']); $createcontent1 = stripslashes($_POST['createcontent1']); $createcontent2 = stripslashes($_POST['createcontent2']); $createcontent3 = stripslashes($_POST['createcontent3']); $createcontent4 = stripslashes($_POST['createcontent4']); $string = '<?php $page_num = "'. $createcontent. '"; $pathtometa = '. $createcontent1. '; include ("'. $createcontent2. '"); include ("'. $createcontent3. '"); include ("'. $createcontent4. '"); ?>'; $fp = fopen("content-page-create-page.php", "w"); fwrite($fp, $string); fclose($fp); } else header("Location: $admin_redirect"); die(""); ?> right now it inputs the content i want in the file... I guess I need to see if I can setup a couple selects to save some variable for what the file should be called and then where to store it (directory)
  6. The Users of the template only need simple 5 page sites, and some of them don't have access to a db, plus it's not needed, I am just providing the tool.... I posted to soon... here is what I am working with now $string = '<?php $page_num = "'. $_POST["set_page_num"]. '"; $pathtometa = "'. $_POST["setpathtometa"]. '"; include ("'. $_POST["incvar1"]. '"); include ("'. $_POST["incvar2"]. '"); include ("'. $_POST["incvar3"]. '"); ?>'; $fp = fopen("content-page-create-page.php", "w"); fwrite($fp, $string); fclose($fp);
  7. Hey, I am trying to build a feature into my template that will automatically setup a page without having to create a file and paste the 5 lines of code, and then switch the page number automatically then upload it to the server.... No database either. this is what needs to be added into the file inorder for it to work as a page: <?php $page_num = "1"; $pathtometa = $_SERVER["DOCUMENT_ROOT"].'/inc/meta.php'; include ("$pathtometa"); include ("$var/global-control.php"); include ("$var/page.php"); ?> I can create a file and post to it...but I need exactly what's above $createcontent = stripslashes($_POST['createcontent']); fwrite($fp, $createcontent); fclose($fp); $filename = "createdfile.php"; $filehandle = fopen($filename, 'w') or die("can't open file"); if ($filehandle) { fwrite($filehandle, $createcontent); fclose($filehandle); } any help would be appreciated thanks
  8. Hey, I have file_get_contents working on my server, I am in the process of building a template that will then be distributed to multiple people, I would like to have a News/What's New box within the template so I can update it from my domain. My question: Will this work across other servers grabbing info from the server where my main domain is hosted, I tested between 2 domains on the same server, wondering when someone installs on there server if it will work or not? Thanks
  9. Hey All, I am trying to finish the last step of my site map generator for a template I built. Here is the Process: User Submits meta info and a URL (stored in a .php file) Sitemap tool loops through and grabs the URL's and adds them to a list (to be used in the sitemap) User copies list of URL's and pastes them into the tool Outcome is: <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://www.dev.domain.com/ </loc> <priority>1</priority> </url> <url> <loc>http://www.dev.domain.com/page-2.php </loc> <priority>0.83</priority> </url> <url> <loc>http://www.dev.domain.com/page-3.php </loc> <priority>0.67</priority> </url> <url> <loc>http://www.dev.domain.com/page-4.php</loc> <priority>0.5</priority> </url> </urlset> All I am trying to do now is have a form so the user can copy the above paste it into the text box and hit submit. That would open the sitemap.xml file and paste in the already formatted xml. Is this possible? Thanks for any help,
  10. Ok, I understand that, But would: domain.tld/my-page-name.php be better than domain.tld/page.php?page=my-page-name or does it not matter
  11. Hey, I started working on my Simple CMS... and I understand how to create/store content to a db, however I am having a hard time trying to figure out how to put it all together. My main problem is using the title to create a file that will then load the db content. website.com/my-page.php where my-page.php is stored in an Articles directory, with an include of some sort to retrieve the content. Can anyone point me in a good direction? Thanks, all help is appreciated.
  12. ...I don't think it's as easy as that.... I have a 60 page template site where I set meta description and keywords... what if someone wants to change their keywords? just appending won't work.
  13. Thanks, Definitely gives me a sense of direction on how I can achieve my end result. I will do some research and see what I can come up with. It's kinda like....if it's not to to daunting I will add it, if not I won't bother. Main reason there is NO database.... and I am making a DB version soon...things will be significantly easier using MySQL.
  14. Hey, I am currently using a form that submits Keywords, description, and page title. I currently use a separate file per page... it's a template site that does not have a database, and needs to remain without one. Contains 60 pages Is it possible to save all this data to 1 file instead 1 file per page? I would need to be able to open the "meta" file and ADD to it instead of Write over/replace what's there....as that's what happens now when you update your meta info. I am using the form to store variables to an array and then using fopen I store the variables to a file. Here is the form that submits the data $readmeta = file_get_contents("content-page-$cp_number-meta.php"); $metadata = unserialize($readmeta); extract($metadata); echo <<< _END <div class="clear"></div> <form method='post' action='admin-submit-meta.php?edit_page=$cp_number'> <ul class="edit-form" style="float: left;"> <li><label class="label">Select Template:</label> <select name="updatetemplate"> </select> </li> </ul> <ul class="edit-form" style="float: right;"> <li><label class="label-400">Current Template: <span style="color: #f06c32;">$artemplate</span></label></li> </ul> <div class="clear"></div> <ul class="edit-form"> <li><label class="label">Page Name</label><br /><input class="text" type='text' maxlength='300' name='updatemeta0' value='$arpagetitle' /></li> <li><label class="label">Title</label><br /><input class="text" type='text' maxlength='300' name='updatemeta1' value='$artitle' /></li> <li><label class="label">Keywords</label><br /><input class="text" type='text' maxlength='300' name='updatemeta2' value='$arkeyword' /></li> <li><label class="label">Description</label><br /><input class="text" type='text' maxlength='300' name='updatemeta3' value='$ardesc' /></li> </ul> <ul class="edit-form"> <li class="edit-form-submit"><input src="../themes/theme-admin/default-admin-template/images/meta-submit.jpg" type='image' value='Login' name='submit' /></li> </ul> </form> <div class="clear"></div> _END; Here is my Action page: $updatemeta0 = $_POST['updatemeta0']; $updatemeta1 = $_POST['updatemeta1']; $updatemeta2 = $_POST['updatemeta2']; $updatemeta3 = $_POST['updatemeta3']; $updatetemplate = $_POST['updatetemplate']; $value = array( 'arpagetitle' => "$updatemeta0", 'artitle' => "$updatemeta1", 'arkeyword' => "$updatemeta2", 'ardesc' => "$updatemeta3", 'artemplate' => "$updatetemplate" ); $fp = fopen("content-page-1-meta.php", "w"); fwrite($fp,serialize($value)); break;
  15. Hey All, I am trying to figure out how I can eliminate having to log in 2 times. There is no database. it just sets a session, but because the browser doesn't refresh you have to login 2 times. Looking for some sort of "check" solution... any suggestions? if (isset($_POST['username'])) { $username = $_POST['username']; $password = $_POST['password']; if ($username == "" || $password == "") { $error = "<div id=\"login-warning-box\"><center><p class=\"login-text\">Not all fields were entered.</p></center></div>"; } else { if ($username != "$set_username" || $password != "$set_password") { $error = "<div id=\"login-warning-box\"><p class=\"login-text\">Username/Password invalid.</p></div>"; } else { $_SESSION['username'] = $username; $_SESSION['password'] = $password; $admin_panel = "$admin_panel_url"; header ("Location: $admin_panel");//CHANGE DOMAIN die(""); } } } header.php ob_start(); session_start(); if (isset($_SESSION['username'])) { $username = $_SESSION['username']; $loggedin = true; } else $loggedin = false; thanks,
  16. After a bit of searching I found this: <?php // Simon Willison, 16th April 2003 // Based on Lars Marius Garshol's Python XMLWriter class // See http://www.xml.com/pub/a/2003/04/09/py-xml.html class XmlWriter { var $xml; var $indent; var $stack = array(); function XmlWriter($indent = ' ') { $this->indent = $indent; $this->xml = '<?xml version="1.0" encoding="utf-8"?>'."\n"; } function _indent() { for ($i = 0, $j = count($this->stack); $i < $j; $i++) { $this->xml .= $this->indent; } } function push($element, $attributes = array()) { $this->_indent(); $this->xml .= '<'.$element; foreach ($attributes as $key => $value) { $this->xml .= ' '.$key.'="'.htmlentities($value).'"'; } $this->xml .= ">\n"; $this->stack[] = $element; } function element($element, $content, $attributes = array()) { $this->_indent(); $this->xml .= '<'.$element; foreach ($attributes as $key => $value) { $this->xml .= ' '.$key.'="'.htmlentities($value).'"'; } $this->xml .= '>'.htmlentities($content).'</'.$element.'>'."\n"; } function emptyelement($element, $attributes = array()) { $this->_indent(); $this->xml .= '<'.$element; foreach ($attributes as $key => $value) { $this->xml .= ' '.$key.'="'.htmlentities($value).'"'; } $this->xml .= " />\n"; } function pop() { $element = array_pop($this->stack); $this->_indent(); $this->xml .= "</$element>\n"; } function getXml() { return $this->xml; } } /* Test $xml = new XmlWriter(); $array = array( array('monkey', 'banana', 'Jim'), array('hamster', 'apples', 'Kola'), array('turtle', 'beans', 'Berty'), ); $xml->push('zoo'); foreach ($array as $animal) { $xml->push('animal', array('species' => $animal[0])); $xml->element('name', $animal[2]); $xml->element('food', $animal[1]); $xml->pop(); } $xml->pop(); print $xml->getXml(); */ ?> havn't had a chance to play with it yet though.
  17. Thanks, but no thanks... i am aware of webmaster tools... Not looking for alternate solutions. looking for a solution to my problem. I am marketing to a particular group.
  18. Hey All, I have recently been developing a template with a built in WYSIWYG editor and it saves data to a file using fopen. I also setup a separate form that saves meta data to a file. There is no database at all. I tried looking all over, but everything is based on MySQL. I am looking for a way to generate a sitemap for the pages the user chooses. so if the user has a 5 page website, they would open the edit page for lets say index.php I would have a separate form for the Sitemap info. that will save to a file. I am curious how I can create a script that will open the Sitemap info files and generate a sitemap. End result can either create a sitemap file and save it to the root, or output the xml code that the user can copy and paste into their sitemap.xml file Thanks in advance. Carlo
  19. Hey, First off the sample below works...but... I am unsure on how I can make this a drop down selection... Currently I have a form that updates a variable (stored in a file) and it's based on the answer of yes or no. All this does is activate a template change (turns on a theme across all pages, or turns it off) The Form $readmeta = file_get_contents('content-page-global-template.php'); $metadata = unserialize($readmeta); extract($metadata); echo <<< _END <div class="clear"></div> <br /> <br /> <div class="meta-form"> <form method='post' action='admin-submit-meta.php?edit_page=admin-gt'> <ul class="single"> <li><label>Global Template<br />(Type on or off)</label><input type='text' maxlength='300' name='updateglobalswitch' value='$argtswitch' /></li> <li><label>Template</label><input type='text' maxlength='50' name='updateglobaltemplate' value='$argttemplate' /></li> <li><input type='submit' name='submit' /></li> </ul> </form> </div> <div class="clear"></div> <br /> <br /> _END; The Action .... Opens the file and stores info. include ("admin-header.php"); //Must have to allow access to admin panel or any pages within admin panel if ($loggedin) { $updatemeta1 = $_POST['updatemeta1']; $updatemeta2 = $_POST['updatemeta2']; $updatemeta3 = $_POST['updatemeta3']; $updatetemplate = $_POST['updatetemplate']; $value = array( 'artitle' => "$updatemeta1", 'arkeyword' => "$updatemeta2", 'ardesc' => "$updatemeta3", 'artemplate' => "$updatetemplate" ); //Members Page $edit_page = $_GET["edit_page"]; if ($edit_page == "") { $edit_page = "1"; } switch ($edit_page) { case '0': { break; } case 'admin-gt': { $updateglobalswitch = $_POST['updateglobalswitch']; $updateglobaltemplate = $_POST['updateglobaltemplate']; $value = array( 'argtswitch' => "$updateglobalswitch", 'argttemplate' => "$updateglobaltemplate" ); $fp = fopen("content-page-global-template.php", "w"); fwrite($fp,serialize($value)); break; } } if (!$fp) { echo "Couldn't open the data file. Try again later."; exit; } fclose($fp); $sheet_name = "edit-page"; //**IMPORTANT** selects control informaiton. $global_template = "true";//Used to change all pages templates at once $single_template = "true";//Loads the Template $load_template = "load_template_admin"; $var = $_SERVER["SITE_HTMLROOT"] . '../../inc'; //**IMPORTANT** defines the path for the Global Control to load. include ("$var/global-control.php"); include ("$inc_sub2$inc_control"); //Path to Control File and Control File **Edit path based on directory level of Sub Folder, only edit control if you have multiple control files include ("$inc_sub2$template_top"); //**Edit path based on directory level of Sub Folder include("content-page-admin-menu.php"); ?> <div class="clear"></div> <?php switch ($edit_page) { case '0': { break; } case 'admin-gt': { include ('content-page-global-template.php'); break; } } And here is a file I include in every page... //Turns a Single Theme on for all pages $readmeta = file_get_contents("http://$website_domain/inc/admin/content-page-global-template.php"); $metadata = unserialize($readmeta); extract($metadata); $gt_switch = "$argtswitch"; $gt_template = "$argttemplate"; $global_template_switch = "$gt_switch"; $load_global_template = "$gt_template"; Thanks in Advance
  20. Hey, Ok, I am attempting this.... and a bit lost, I am trying to get a form to save to an Array... not sure of this part Here is the form <form method='post' action='admin-submit-meta.php?edit_page=5'> <ul class="single"> <li><label>Title</label><input type='text' maxlength='16' name='updatemeta[]' value='updatemeta' /></li> <li><input type='submit' name='submit' /></li> </ul> </form> I will need 3 or 4 fields... title, keywords, description then on submit if I can get them into an array... foreach($_POST['updatemeta'] as $value){ } $fp = fopen("content-page-5-meta.php", "w"); fwrite($fp,serialize($value)); Saves to the file ok Then before I include my template-top // Reading the data $readmeta = file_get_contents('inc/admin/content-page-5-meta.php'); $metadata = unserialize($readmeta); // Now you can access those normally like arrays: echo $metadata['updatemeta']; // Or if you want those to be variables you can use extract function extract($metadata); echo $updatemeta; $title = "$updatemeta"; I include my template-top with the html <head> and set the title with <title><?=$title?></title> I am getting this error Warning: extract() [function.extract]: First argument should be an array in /home/insidegu/public_html/contact.php on line 19 Any Ideas, I know it has something to do with the array, but i never understood them so I am trying to tackle this. I used this as a resources // set and write data for example $store = array( 'name' => 'John', 'age' => 29, 'location' => 'Finland', 'hobby' => 'music' ); $fp = fopen('info.txt','w'); fwrite($fp,serialize($store)); // Reading the data $infotxt = file_get_contents('info.txt'); $info = unserialize($infotxt); // Now you can access those normally like arrays: echo $info['name']; echo $info['age']; echo $info['location']; echo $info['hobby']; // Or if you want those to be variables you can use extract function extract($info); echo $name; echo $age; ... And found this other thread http://www.phpfreaks.com/forums/index.php?topic=234067.0 Tried to figure it out... now need a bit of assistance, Any help is greatly appreciated. thanks in advance
  21. by storing somewhere do you mean only in a database, or can i store it in a separate php file?
  22. Hey, I use a control file to set my meta tags and titles Here's an example <?php switch ($sheet_name) { case 'page-2'://The page that has $sheet_name equal to the case value, this is the link to tell the page what info to use { $page_id = "2";//Standard Page ID $page_location = "home";//Multi Purpose control, Adds Menus, forms or whatever you create. //Header Controls $level_value = "inc";//Used for Path to Stylesheets and Scripts $title = "About Us";//Title of Page $meta_desc = "About Us";//Description of Page $meta_key = "About Us";//Keywords of Page //Add Different Elements $content_area = "true"; break; } ?> I want to eliminate the need to open this control.php file, I want to use a form to update the case variables. Any suggestions? Little bit lost on where I should start since I have only posted to a database. Reason for doing this, everything else is done through an admin panel except this one file and I would like to integrate it with the admin area to eliminate the need to open any files. ** side note, this is a template site I built, and does not use a database, crucial for the market im in.
  23. Hey, I have setup a template that will over write content files, there is no database, it a set theme of 15 pages, and I used includes for the content area that get brought into tinymce where you can then use the WYSIWYG editor. I have set variables so you can change themes per page or across all 15 pages. Here is the form echo <<< _END <div class="clear"></div> <form method="post" action="admin-submit-page.php?edit_page=change-theme"> <textarea name="content" cols="98" rows="40"> _END; include ('content-page-change-theme.php'); <--------------------this is the include that sets the variables for which theme should be used echo <<< _END </textarea> <input type="submit" name="SUBMIT" /> </form> _END; then $fp = fopen("content-page-change-theme.php", "w"); if (!$fp) { echo "Couldn't open the data file. Try again later."; exit; } $content = stripslashes($_POST['content']); fwrite($fp, $content); fclose($fp); I FOUND this online and tried it Here is quick and dirty way to add PHP editing capabilities to your TinyMCE. Javascript On the JavaScript side initiate TinyMCE as you normally would, and add setup editor event ( in bold below) <script type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "advanced", theme_advanced_buttons1 : "mybutton,bold,italic,underline", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", plugins : 'inlinepopups', setup : function(ed) { //This event (onBeforeSetContent)gets executed when the setContent method is called //gets executed when the setContent method is called but before the contents gets //serialized and placed in the editor. ed.onBeforeSetContent.add(function(ed, o) { //replace all instances of <?php and ?> with HTML entities o.content = o.content.replace(/<\?/gi, "&lt?"); o.content = o.content.replace(/\?>/gi, "?&gt"); }); } }); </script> then on php side PHP On the PHP side take the TinyMCE content and convert the HTML entities back to <?php and ?> $content = str_replace("<?php", "<?php", $content); $content = str_replace("?>", "?>",$content); I tried putting the str_replace in different spots, but I don't think the javascript replaced my php tags, any ideas how i can get this working?
  24. Ok, Been trying for a couple hours now This is my login page that will check if there is a blank field, or if the User/Pass is wrong form the database I have a column called administrator, by default it's 0, If I create an admin account it's 1 All I would like it to do is check that. I can either get it to not log me in at all, or it logs any user in. Anyone? <?php $sheet_name = "ad-member-login"; include ("../inc/crash-course-control.php"); //main inc dir. include ("inc/ad-member-functions.php"); //users inc dir. include ("inc/ad-member-header.php"); include ("../inc/login-top.php"); echo $content; if (isset($_POST['username'])) { $username = sanitizeString($_POST['username']); $password = sanitizeString($_POST['password']); if ($username == "" || $password == "") { $error = "<div id=\"warning-box-login\"><center><p class=\"main-text\">Not all fields were entered.<br /><br /></p></center></div>"; } else { $query = "SELECT username,password FROM adccmembers WHERE username = '$username' AND password = MD5('$password')"; if (mysql_num_rows(queryMysql($query)) == 0) { $error = "<div id=\"warning-box-login\"><p class=\"main-text\">User/Pass invalid<br /><br /></p></div>"; } else { $_SESSION['username'] = $username; $_SESSION['password'] = $password; header('Location: http://www.affiliatedeveloper.com/crash-course/index.php'); die(""); } } } echo <<< _END <div id="login-box"> <div id="login-box-left"> <center> <br /> <h2>Welcome To The Members Area</h2> <br /> <img src="http://www.affiliatedeveloper.com/images/login-logo.jpg" alt="Affiliate Developer" /> </center> </div> <div id="login-box-right"> <br /> <center><p>Welcome to the Affiliate Developer Member Panel!</p></center> <br /> <div class="user-login-form"> <form method='post' action='ad-member-admin-login.php'> <ul class="single"> <li><label>Username</label><input type='text' maxlength='16' name='username' value='$username' /></li> <li><label>Password</label><input type='password' maxlength='32' name='password' value='$password' /></li> <li><a href="ad-member-forgot-password.php">Forgot Password</a></li> <li><input type='submit' value='Login' /></li> </ul> </form> </div> <div class="clear"></div> $error $error1 </div> </div> _END; include ("../inc/login-bot.php"); ?> Thanks
  25. Hey, Just creating a login for admins, if administrator is 0 your not an admin otherwise if its 1 let em in. here is my code, I'm missing something, it just doesn't let me in even if administrator = 1 Thanks in advance <?php $sheet_name = "ad-member-login"; include ("../inc/crash-course-control.php"); //main inc dir. include ("inc/ad-member-functions.php"); //users inc dir. include ("inc/ad-member-header.php"); include ("../inc/login-top.php"); echo $content; if (isset($_POST['username'])) { $username = sanitizeString($_POST['username']); $password = sanitizeString($_POST['password']); if ($username == "" || $password == "") { $error = "<div id=\"warning-box-login\"><center><p class=\"main-text\">Not all fields were entered.<br /><br /></p></center></div>"; } else { $query = "SELECT username,password FROM adccmembers WHERE username = '$username' AND password = MD5('$password')"; if (mysql_num_rows(queryMysql($query)) == 0) { $error = "<div id=\"warning-box-login\"><p class=\"main-text\">Username/Password invalid.<br /><br /></p></div>"; } elseif ($query = "SELECT administrator FROM adccmembers WHERE username = '$username' AND administrator = '$administrator'") if (mysql_num_rows(queryMysql($query)) == 0) { $error1 = "<div id=\"warning-box-login\"><p class=\"main-text\">You are not an Administrator<br /><br /></p></div>"; } else { $_SESSION['username'] = $username; $_SESSION['password'] = $password; header('Location: http://www.affiliatedeveloper.com/crash-course/index.php'); die(""); } } } echo <<< _END <div id="login-box"> <div id="login-box-left"> <center> <br /> <h2>Welcome To The Members Area</h2> <br /> <img src="http://www.affiliatedeveloper.com/images/login-logo.jpg" alt="Affiliate Developer" /> </center> </div> <div id="login-box-right"> <br /> <center><p>Welcome to the Affiliate Developer Member Panel!</p></center> <br /> <div class="user-login-form"> <form method='post' action='ad-member-admin-login.php'> <ul class="single"> <li><label>Username</label><input type='text' maxlength='16' name='username' value='$username' /></li> <li><label>Password</label><input type='password' maxlength='32' name='password' value='$password' /></li> <li><a href="ad-member-forgot-password.php">Forgot Password</a></li> <li><input type='submit' value='Login' /></li> </ul> </form> </div> <div class="clear"></div> $error $error1 </div> </div> _END; include ("../inc/login-bot.php"); ?>
×
×
  • 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.