Jump to content

Wayniac

Members
  • Posts

    89
  • Joined

  • Last visited

    Never

About Wayniac

  • Birthday 12/22/1987

Contact Methods

  • Website URL
    http://www.lifelikemedia.ca/

Profile Information

  • Gender
    Male
  • Location
    Canada

Wayniac's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks for the tip, is there any advantage to why I would use empty()? Is the other depreciated?
  2. Thank you onlyican, that worked perfectly.
  3. I think I could reword it a little better. I'm trying to accomplish an action from an if statement that will work if anything from a space, to a letter, to a full fledge word is entered in the value spot within the "". Ex: <?php if ($fname == "ANYTHING") { // But I can't just put ANYTHING in that slot via server side, it would have to be typed. //blah blah } ?>
  4. Hello all, Just a quick one here, I'm not sure what to put in the quotations of an if statement if I want to say if value equals ANYTHING. Thanks
  5. Thank you all so much! The level code works wonderfully. The idea of using levels instead of names is brilliant, I should have planned it more before jumping right into it. Once again, thank you all so much, I'm going to go check out some of the usful links you all posted above. Thank you!
  6. Oh haha, sorry must have been an old code. I'm still getting this error: Parse error: syntax error, unexpected '{' in /mnt/w0340/d16/s01/b02c73a9/www/lifelikemedia.ca/wtt/crm/login.php on line 28 This is line 28: if(!in_array($_SESSION["username"] , $only){ But it needs to have that there....
  7. Thank you Dezkit, I am following your code at the moment, but I may have made a mistake with my syntax. Here is the code below. <?php // load the configuration file. include("config.php"); ?> <? // 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']; $password=$_POST['password']; // Check matching of username and password. $result=mysql_query("select * from admin where username='$username' and password='$password'"); if(mysql_num_rows($result)!='0'){ // If match. //session_register("username"); // Create session username. //$_SESSION['username'] // Create session username. $_SESSION['username'] = $username; $only = array("john"); if(!in_array($_SESSION["username"] , $only){ header("location:intheloop.php"); // Re-direct to intheloop.php } exit; }else{ // If not match. $message="Invalid Username or Password<br>"; } } // End Login authorize check. ?>
  8. Thank you PFMaBiSmAd and radar. What I am attempting to accomplish is to have several usernames and restricted access for them to some pages, but not others. So John would have access to example1.php, but not example2.php and emily vice-verse, etc. Here is my complete code below: <?php // load the configuration file. include("config.php"); ?> <? // 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']; $password=$_POST['password']; // Check matching of username and password. $result=mysql_query("select * from admin where username='$username' and password='$password'"); if(mysql_num_rows($result)!='0'){ // If match. $_SESSION['username'] // Create session username. header("location:intheloop.php"); // Re-direct to intheloop.php exit; }else{ // If not match. $message="Invalid Username or Password<br>"; } } // End Login authorize check. ?> PS: Trying what you posted will35010, thank you.
  9. Hello everyone, I'm attempting to find only a specific username in this field "username" located in the database. The code below works when with the rest of the I left out since its not important for this problem. What I would like to do is have it so if I type in the name "john, emily, or chris", and if the name is in the field, then it works. session_register("username"); // Working code, username is the field name. Ex: session_register("john | emily | chris"); // Example code, populated with values. I would like to work the same, except with values instead of using the field name. Let me know if you need any further clarification, thank you.
  10. If I can reword or explain a specific section in more detail, please let me know and I'll do so. Thank you
  11. Below is my previous code I had working in the manner it would change the price, sub_total, tax, sh, total, and total_paid input fields to 0. There are two problems with this... 1. When it outputs to the input fields, the value displays as 0 instead of 0.00. 2. I need to have it only react when the value typed into the input field "trees_sold" is "0". If any higher, I would like it to ignore the statement. <!-- Comp all prices to zero value --> <SCRIPT LANGUAGE="JavaScript"> var trees_sold = 0.00; function InitSaveVariables(form) { price = form.price.value; sub_total = form.sub_total.value; tax = form.tax.value; sh = form.sh.value; total = form.total.value; total_paid = form.total_paid.value; } function CompPrices(form) { if (trees_sold == 0.00) { InitSaveVariables(form); form.price.value = 0.00; form.sub_total.value = 0.00; form.tax.value = 0.00; form.sh.value = 0.00; form.total.value = 0.00; form.total_paid.value = 0.00; } } </script> <input name="trees_sold" id="trees_sold" size="15" onkeyup="javascript:CompPrices(this.form);" maxlength="15" /> Below is my current code I'm working with that I can't seem to get to function properly. I've modified the first two lines of code here, and am attempting to pull any data that is typed in and automatically take into consideration if it is a "0" value, it reacts as my code below says "if (trees_sold == 0.00)" and if anything else, it will not do anything. This is not working unfortunately. <!-- Comp all prices to zero value --> <SCRIPT LANGUAGE="JavaScript"> form.trees_sold.value = ""; trees_sold = form.trees_sold.value; function InitSaveVariables(form) { price = form.price.value; sub_total = form.sub_total.value; tax = form.tax.value; sh = form.sh.value; total = form.total.value; total_paid = form.total_paid.value; } function CompPrices(form) { if (trees_sold == 0.00) { InitSaveVariables(form); form.price.value = 0.00; form.sub_total.value = 0.00; form.tax.value = 0.00; form.sh.value = 0.00; form.total.value = 0.00; form.total_paid.value = 0.00; } } </script> <input name="trees_sold" id="trees_sold" size="15" onkeyup="javascript:CompPrices(this.form);" maxlength="15" /> Anyone have any ideas? Thank you.
  12. I think I understand now. You definatly set me in the right direction. I will have to do more research, otherwise I'm just typing and not learning. Once again, thank you so much
  13. Sorry, I'm not usually this confused, perhaps I'm just really tired. Could you tell me how I can get my field "ship_date" which is on my webpage that sends off the data to my mysql database when submitted to either be stored as MM-DD-YYYY or when I try an retrieve it on my other page that views the entry to be displayed as MM-DD-YYYY. Sorry if I'm making this difficult for you, I really do appreciate you helping me.
  14. Once again, thank you so much. But was I suppose to run this query through a php code? This is what happens when I enter it in the phpmyadmin SQL section: DATE_FORMAT( date_ship, '%m/%d/%Y' ) 00/00/0000 Which is great, but when I browse the fields section, its still 0000/00/00? You said earlier the database format never changes, how would I approach this then? Thank you
×
×
  • 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.