Jump to content

skoobi

Members
  • Posts

    48
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

skoobi's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi im currently learning php and mysql and as a test (or a lesson) i thaught id do a timesheet site which adds the time and date and so on to the datatbase. Now im at the stage where i want to actually view the times for a particular date... The problem im getting is that with the date picker which is a simple dropdown menu for the days/month/year but when i submit the form to the view.php file the result i get is 'Submit Query' which is the value of the button... Can someone give me a few pointers on what im doing wrong!!! Thank you Chris
  2. Ah missed that one... Well after the spelling corrections and missing bracket Im getting another error which i cant work out. 'Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in path_to_dir/register_funcs.php on line 85' Line 85 is this again... // Must have at least one character if (strspn($_POST['user_name'],$span_str) == 0) { return false; }
  3. Brilliant thank you they were very usefull.. I also baught Pro Zend Framework Techniques which has helped as well and ive finally made a project...
  4. Hi im still learning php and have been running through the tutorials on making a user authentication system but im getting an error on one line but ive got the same code else where and its fine... // Must have at least one character if (strspn($_POST['user_name'],$span_str) == 0) { return false; } Im getting the error on the if statment but no matter what i try it still tells me theres an error... Heres the full function code: function account_namevalid() { // parameter for use with strspan $span_str = "abcdefghijklmnopqrstuvwxyz" . "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-"; // Must have at least one character if (strspn($_POST['user_name'],$span_str) == 0) { return false; } // Must contain all legal characters if (strspn($_POST['user_name'],$span_str) != srnlen($name)) { return false; } // Min and Max length if ($strlen($_POST['user_name']) < 5) { return false; } if strlen($_POST['user_name']) > 25 { return false; } // Illegal names if (eregi("^((root)|(bin)|(deamon)|(adm)|(lp)|(sync)|(shutdown)|(halt)|(mail)|(news)|(uucp)|(operator)|(games)|(mysql)| (httpd)|(nobody)|(dummy)|(www)|(cvs)|(shell)|(ftp)|(irc)|(debian)|(ns)|(download)))$", $_POST['user_name'])) { return false; } if (eregi("^(anoncvs_)", $_POST['user_name'])) { return false; } return true; } Any help or info would be greatfull... Cheers Chris
  5. Hi thanks for your reply after a bit of working out what im going to do on the site and whats needed for it and so on i think your right with the database... It was going to be a small site only a 2-3 page site with a few values that i can input manualy into the code. But after some thaught about what happens if it takes off and i need to add stuff to it, then id have to redesign it all again so i think a database is definetly the way to go like you suggested... Thank you for your help... (have posted another problem up now though lol) Cheers Chris
  6. Hi im not sure if this can be done or not but im trying to do a site without using mysql and i want to be able to compare 3 values and depending on the values have them aranged lowest to highest... for example: Apple = 8 Pear = 3 Bannana = 5 so the results would be displayed like... Pear with a total of 3 bannana with a total of 5 Apple with a total of 8 Is this possible using just PHP or will i need to use Mysql as well... Thank you Chris
  7. Hi ive been trawling the web and found loads of usefull tutorials for the zend framework but none which actually help me for what i want to do (either that or im mising something)... I want to use the zend framework for creating a basic website to start off with but i will then want to develop the site into a more interactive site i.e. including an admin area and a content managed system for editing articles (not creating new ones)... After searching the web ive noticed that everybody uses frameworks of some kind now and im wanting to branch into doing the same. Most of the sites i produce at the moment are all php driven and i know a fair bit of php. Does anyone know of any tutorials (begginers) for creating a basic website using the zend framework or can anyone suggest where the best place to start is... Cheers Chris
  8. Hi im sort of teaching myself how to code in php. even though i can do it there's still a few things im getting stuck on so im hoping someone will be able to help... Im currently going through a cms tutorial on the net (yes i know there's pre-made ones like joomla but i want to learn how they work) and ive got to the end of it but im getting this error... Notice: Undefined variable: HTTP_GET_VARS in C:\wamp\www\CustomCMS\cmsadmin\login.php on line 9 I know this is depreciated and you need to use the $_POST method now but as soon as i do that i get another error... Notice: Undefined index: user in C:\wamp\www\CustomCMS\cmsadmin\login.php on line 5 Heres the code for the login script.. <?php require_once("../includes/Sentry.php"); $sentry = new Sentry(); if ($HTTP_POST_VARS['user'] != ''){ $sentry->checkLogin($HTTP_POST_VARS['user'],$HTTP_POST_VARS['pass'],4,'welcome.php','failed.php'); } if ($HTTP_GET_VARS['action'] == 'logout'){ if ($sentry->logout()){ echo '<center>You have been logged out</center><br>'; } } ?> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="25%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000066"> <tr> <td align="center" bgcolor="#000066"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Login</strong></font></td> </tr> <tr> <td bordercolor="#FFFFFF"><form name="form1" method="post" action="login.php"> <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><br> User: <input type="text" name="user"> </font></p> <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> Pass: <input type="password" name="pass"> </font></p> <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <input type="submit" name="Submit2" value="Submit"> </font></p> </form> <div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="login.php?action=logout">Logout</a> </font></div> </td> </tr> </table> </body> </html> Ive gone through the net trying to find a solution but i cannot find anything on this one... I dont mind going through every page sorting this out as its just a learning curve for me... If anyone could shed some light on this for me i would be most grateful... Thank you chris
  9. Ye just a thaught thats all. I didnt think it could be done... Ive just created a error page that is global to everything instead ... Thanks for your help though... Cheers
  10. Hi sorry.. ive already done that but id have to make a file for all the errors i.e 404, 401, 500 and so on... i was just wondering if there was a way to use 1 file called error and display the error on there ... not sure if it is possible or not... Thank you for you reply
  11. Hi im a little stuck... What im trying to do is when you request a page that is not there it goes to a custom error page. I have set the redirect via the .htaccess file. Basicly what im trying to do is only have one php file which displays the server response i.e. 404 error or 401 error and so on rather than having several error pages. So in the code <h1>Oopppsss!!!! <!-- ERROR TO DISPLAY HERE i.e. 404 page not found --></h1> <p>There seems to be a problem... The page you are looking for does not exist or has moved. This is a permanent error. If you think this is a mistake please get in touch either by giving us a ring on 101010 or by filling out the web form on the <a href="contact-me.php">contact me</a> page...</p> Any thaught on how i can do this or is it not possible... Cheers
  12. Hi im currently in the process of creating a site but with a custom cms. The only thing that needs changing on the site is the content. The problem ive got is the way ive linked the content to the menu. at the moment it is index.php?id=1,2,3,4 and so on. How do i get the content to link to the menu as a proper menu name like about.php but still be able to pull the relevant information down to the site. Also i am a newbie... Cheers Chris
  13. Hi im getting this error whith the login script ive implemented and cannot figure it out at all... Notice: Undefined variable: message in \admin\enquiry\index.php on line 189 this is the index file: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head> <script type="text/javascript" language="JavaScript" src="index.php_files/chipsaway.js"></script> <!-- REMOVE <script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <script src="../SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script>--> <script src="scripts/jquery/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="scripts/jquery/plugins/validate/jquery.validate.min.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="styles/dropdown.css"> <link rel="stylesheet" type="text/css" href="../../styles/guarantee-css.css"> <style type="text/css"> <!-- .red { color: #F00; } .small { font-size: small; color: #F00; } #address-container { width: 100%; } #address-container ul { list-style: none; margin: 0; padding: 0; border: none; } #address-container li:hover { color:#339999; } #loader-img{ display:none; } label.error{ color: #F00; display:block; clear: both; } --> </style> <script type="text/JavaScript"> <!-- function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } //--> $ = jQuery.noConflict(); /** * Jquery set up for using the address finder */ $(document).ready(function() { /** * Find address */ var showing_address = false; $('#loader-img').ajaxStart(function(){ $(this).toggle(); }); $('#loader-img').ajaxComplete(function(){ $(this).toggle(); }); get_callback = function(data){ $('#address-container').html(data); $('#address-container').slideDown(); showing_address = true; $('#address-container ul li').each(function(){ $(this).click(function(){ $('#address').val($(this).html()); $('#address-container').slideUp(); showing_address = false; }); }); } $('#findadress_btn').click(function(event){ event.preventDefault(); $.get("findaddress.php", { PostCode: $('#PostCode').val()}, get_callback); }); $('#address').focus(function(){ if(showing_address){ $('#address-container').slideUp(); } }); $('#PostCode').keydown(function (event) { if (event.keyCode == 13) { event.preventDefault(); $.get("findaddress.php", { PostCode: $('#PostCode').val()}, get_callback); } }); /** * Validation */ $("#form2").validate({ rules: { name: { required: false }, email: { required: false, email: false }, phone: { required: false, digits: true }, address: { required: false } }, messages: { name: "Please enter your full name.", email: "Please make sure your email address is correct.", phone: {required: "Please enter your full number with dialling code.", digits: "Please only include numbers and remove any spaces." }, address: { required: "Please enter your full address or search above with your post code" } } }); });// end of ready check </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Chipsaway - Admin Franchise Finder</title> </head> <LINK REL="stylesheet" TYPE="text/css" HREF="styles/guarantee-css.css"> </HEAD> <BODY BGCOLOR="#339A99" MARGINWIDTH="0" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0"> <DIV ALIGN="center" CLASS="standard"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="1" HEIGHT="7"><BR> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="881" HEIGHT="31"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="31" HEIGHT="31"> <IMG SRC="images/chipsaway005.gif" WIDTH="31" HEIGHT="31" BORDER="0" ALT=""></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="819" HEIGHT="31" BACKGROUND="images/chipsaway003.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="1" HEIGHT="31"></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="31" HEIGHT="31"> <IMG SRC="images/chipsaway006.gif" WIDTH="31" HEIGHT="31" BORDER="0" ALT=""></TD> </TR> </TABLE> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="881"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="17" HEIGHT="152" BACKGROUND="images/chipsaway001.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="17" HEIGHT="1"></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="847" HEIGHT="152" BGCOLOR="#ffffff" COLSPAN="<? if ($navNum>0) { if ($PAGEuseAlternativeLayout=='on') { echo "9"; } else { echo "7"; } } else { if ($PAGEuseAlternativeLayout=='on') { echo "5"; } else { echo "3"; } } ?>" BACKGROUND="images/chipsaway011.gif"> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="847" HEIGHT="152"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="716"> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="716"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="201"> <A HREF="index.php"> <IMG SRC="images/logo.gif" WIDTH="149" HEIGHT="86" BORDER="0" ALT="Chips Away" HSPACE="26" VSPACE="3"></A><BR> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="1" HEIGHT="9"><BR> </TD> <TD ALIGN="center" VALIGN="top" CLASS="standard" WIDTH="215"><BR> </TD> <TD ALIGN="right" VALIGN="top" CLASS="standard" WIDTH="300"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="1" HEIGHT="21"><BR></TD> </TR> </TABLE></TD> <TD ALIGN="left" VALIGN="bottom" CLASS="standard" WIDTH="131"> </TD> </TR> </TABLE> </TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="17" HEIGHT="152" BACKGROUND="images/chipsaway002.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="17" HEIGHT="1"></TD> </TR> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="17" BACKGROUND="images/chipsaway001.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="17" HEIGHT="1"></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="847" BGCOLOR="#ffffff" STYLE="background-image: url(images/chipsaway019.gif); background-repeat: repeat-y; background-position:top left; font-size: 12px; font-family: Arial;" COLSPAN="<? if ($navNum>0) { if ($PAGEuseAlternativeLayout=='on') { echo "9"; } else { echo "7"; } } else { if ($PAGEuseAlternativeLayout=='on') { echo "5"; } else { echo "3"; } } ?>"> <!--GUARANTEE FORM--> <!--GUARANTEE FORM END--> <IMG SRC="images/spacer.gif" WIDTH="1" HEIGHT="22" BORDER="0" ALT=""> <?php require_once('../../Connections/conContact.php'); ?> <div id="section2"> <div class="content"> <div class="entry" > <form id="form1" name="form1" method="post" action="login.php"> <table align="center"> <tr> <td colspan="2" class="body"><span class="warning"><? echo $message; ?></span></td> </tr> <tr> <td class="body">User :</td> <td class="body"><input name="username" type="text" id="username" /></td> </tr> <tr> <td class="body">Password : </td> <td class="body"><input name="password" type="password" id="password" /></td> </tr> <tr> <td class="body"> </td> <td align="right" class="body"><input name="Login" type="submit" id="Login" value="Login" /></td> </tr> </table> <span class="body"><br/> </span> </form> <p> </p> </div> </div> </div> </p> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="847"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="330"> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" BORDER="0"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="<? echo $TEMPLATEbuttonMargin; ?>"> <IMG SRC="<? echo $WEBSITEinternalPath; ?>lumo/images/spacer.gif" WIDTH="1" HEIGHT="<? echo $TEMPLATEbuttonImageHeader; ?>" BORDER="0" ALT=""><BR> </TD> <TD ALIGN="left" VALIGN="top" CLASS="standard"> <IMG SRC="<? echo $WEBSITEinternalPath; ?>lumo/images/spacer.gif" WIDTH="1" HEIGHT="<? echo $TEMPLATEbuttonTextHeader; ?>" BORDER="0" ALT=""><BR> </TD> </TR> </TABLE> </TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="26"> <IMG SRC="images/spacer.gif" WIDTH="26" HEIGHT="1" BORDER="0" ALT=""></TD> </TR> </TABLE> </TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="17" BACKGROUND="images/chipsaway002.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="17" HEIGHT="1"></TD> </TR> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="17" BACKGROUND="images/chipsaway001.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="17" HEIGHT="1"></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="26" BGCOLOR="#ffffff"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="26" HEIGHT="1"></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="132" BGCOLOR="#ffffff"></TD> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="881" HEIGHT="31"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="31" HEIGHT="31"> <IMG SRC="images/chipsaway007.gif" WIDTH="31" HEIGHT="31" BORDER="0" ALT=""></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="819" HEIGHT="31" BACKGROUND="images/chipsaway004.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="1" HEIGHT="31"></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="31" HEIGHT="31"> <IMG SRC="images/chipsaway008.gif" WIDTH="31" HEIGHT="31" BORDER="0" ALT=""></TD> </TR> </TABLE> </BODY> </html> This is the line in question is a <tr> tag... Any help would be greatfull im going bold... Cheers Chris
  14. Ok i think its solved... The server that it works on has register_globals = enabled and the other doesnt..
  15. Hi im getting this error with a login script i have... It works on my other server but not on the one im on now... Heres the error: 'Notice: Undefined index: Login in ***\admin\enquiry\index.php on line 12' This is the code for the login at the top of the page: <? // Use session variable on this page. This function must put on the top of page. session_start(); ////// Logout Section. Delete all session variable. session_destroy(); $message=""; ////// Login Section. $Login=$_POST['Login']; if($Login){ // If clicked on Login button. $username=$_POST['username']; $md5_password=md5($_POST['password']); // Encrypt password with md5() function. require_once 'conContact.php'; mysql_connect($host,$db_user,$db_password); mysql_select_db($database); // Check matching of username and password. $result=mysql_query("select * from members where username='$username' and password='$md5_password'"); if(mysql_num_rows($result)!='0'){ // If match. session_register("username"); // Craete session username. header("location:main.php"); // Re-direct to main.php exit; }else{ // If not match. $message="<img src=\"images/warning_logon.png\" width=\"20\" height=\"17\" /> Incorrect Username or Password"; } var_dump($_SESSION['username']); } // End Login authorize check. ?> I cant figure it oout it works on 1 server but not the other.. . Nothing has changed either... Any help would be appreciated Cheers Chris
×
×
  • 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.