Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. ok theirs few things wrong with that! is $_SESSION['song'] an array ? theirs no start_session(); $play=array(); $play=$_GET['path']; should be $play=array(); $play[]=$_GET['path'];
  2. atleast one of these should work!! CURDATE(); CURRENT_DATE(); NOW(); you may want to post your tests!
  3. Few questions: are the databases local ? is it possible to change one of the passwords? try <?php $SHAREDDB = NewADOConnection('mysql'); $SHAREDDB->NConnect($server, $user, $pwd, $db2); ?>
  4. the `` (backticks) allow you to use "illegal" words, its not recommended you should really change the name of the field!
  5. Works fine <?php $input = "this 'should' WORK@phpfreaks 555-1234"; if (preg_match('/[^0-9a-z@,_.!:\'\s]+/im', $input)) { echo "Successful match"; } else { echo "Match attempt failed"; } die; ?> you could try if (!preg_match('/[0-9a-z@,_.!:\'\s]+/im', $val)) { $result = "You've used irregular symbols"; break; }
  6. try @mysql_query("SELECT id,name,`desc`,hp,item FROM enemies WHERE `id`>0 ORDER BY rand() LIMIT 1"); desc isn't a valid field name
  7. what happens if you comment out the lines <?php $SHAREDDB = NewADOConnection('mysql'); $SHAREDDB->Connect($server, $user, $pwd, $db2); ?>
  8. OK.. so whats the field's datatype ? please look in my signature for how to ask a question!
  9. Depends on the datatype try $datetime = now(); assuming you want the current date/time.. re-phrase the question
  10. what about this <?php $input = "whatever@nothing"; $input= preg_replace('/[^0-9a-z@,_.!:\'\s]+/im', '', $input); echo $input; // "whatevernothing"; ?> edit: opps to match use <?php if (preg_match('/[^0-9a-z@,_.!:\'\s]+/im', $input)) { # Successful match } else { # Match attempt failed } ?> also added 0-9
  11. what about this <?php $subject= "http://somewebsite.com?var1=value1&var2=value2&var3=value3&"; $Var = "var1"; $Value = "NewValue" $result = preg_replace('/(?:$Var=)(\w+)/im', '$1=$Value', $subject); echo $result; ?>
  12. As a side note.. if your truely worried.. check out these ioncube zend i can't say much about them as they are a little bit costly at the moment but i will probably be getting one of them
  13. OK basically with software.. the company who employed you to write the software should of got you to sign a document that basically signs over any rights to the software is theirs any theirs alone.. if they paid you for writting the software and not for employment then it really depends on the project spec.. (again unless you signed it over to them) for example if i was asked then when i finished the software legally I own the software and he owns a licence.. its all about IPR, If he gave a very detailed brief including how the whole system should work.. then they own the IPR..
  14. you should work that out for yourself but personally i do the following <?php if( isset($_SESSION['id']) && isset($_SESSION['username']) && isset($_SESSION['password']) ) ?> also remember session_start(); mus be used in all pages that use $_SESSION
  15. Please use code tags please ask a question correctly (see my signature)
  16. <?php // Declare Variables $id = $_SESSION['id']; $username = $_SESSION['username']; $password = $_SESSION['password']; $title = 'Chocopi :: Main'; if(isset($id, $username, $password)) ?> OK lets look at this $id gets SET to $_SESSION['id'] thus they ARE set even if $_SESSION['id'] = null (nothing); you need to isset($_SESSION['id']) or !empty($id) or even is_null($id)
  17. Clearer problem would help and code in code tags also helps only problem i hear is something about arrays!! whats NOT working ? whats the error etc see my signature for how to ask a question.. also reading the code line by line does help in some ways but most are used to colour formatted text so useing the code tags will help us
  18. Add <?php print_r($_FILES); ?> at the start and see what pops up at the top when you submit a file!
  19. posting the code may help.. only thing i can workout is you did something wrong! try print_r($_POST); at the top of process1.php
  20. try this <?php ob_start(); // Start Session session_start(); // Login.php require_once('page_header.php'); // Declare Variables // User Defined $username = $_POST['username']; $raw_password = $_POST['password']; // Automatic $title = 'Chocopi :: Login'; $password = md5($raw_password); $date = date('Ymd'); $last_login = "UPDATE Mark SET last_login='$date' WHERE username='$username' && password='$password'"; $login = mysql_query("SELECT id FROM Mark WHERE username='$username' && password='$password'"); $login_check = mysql_num_rows($login); $get_date = "SELECT DATE_FORMAT(last_login, '%d %M %Y') as date FROM Mark"; $reg_date = mysql_query($get_date) or die (mysql_error()); $age = mysql_query("SELECT (TO_DAYS(last_login) - TO_DAYS(reg_date)) as daysreg FROM Mark"); $errors = 0; $error_msg = 'Sorry, but your username and password combination is incorrect.'; // Html Code print("<html> \n"); print(" <head> \n"); print(" <title>$title</title> \n"); print(" </head> \n"); print("<body> \n"); if(isset($_POST["submit"])) { $_SESSION['id'] = "$id"; $_SESSION['username'] = "$username"; $_SESSION['password'] = "$password"; $filename = "login_check.php"; ob_end_clean(); header("Location: ".$filename); } print("<form name=\"login\" method=\"post\" action=\"$_SERVER[php_SELF]\"> \n"); print("<center> \n"); print("<table width=\"70%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"> \n"); print(" <th align=\"center\">Login</th> \n"); print(" <tr> \n"); print(" <td align=\"center\"> \n"); print(" Username: \n"); print(" <input type=\"text\" name=\"username\" value=\"$username\" maxlength=\"20\" /> \n"); print(" </td> \n"); print(" </tr> \n"); print(" <tr> \n"); print(" <td align=\"center\"> \n"); print(" Password: \n"); print(" <input type=\"password\" name=\"password\" value=\"$raw_password\" maxlength=\"20\" /> \n"); print(" </td> \n"); print(" </tr> \n"); print(" <tr> \n"); print(" <td align=\"center\"> \n"); print(" <input type=\"submit\" name=\"submit\" value=\"Login\" /> \n"); print(" </td> \n"); print(" </tr> \n"); print(" <tr> \n"); print(" <td align=\"center\"> \n"); print("<font color=\"#ff0000\"> \n"); // Error Message if ($errors > 0) { echo $error_msg ; } // Finish Html Page print("</font> \n"); print(" </td> \n"); print(" </tr> \n"); print(" <tr> \n"); print(" <td align=\"center\"> \n"); print(" <br /><a href=\"register.php\">Register</a> \n"); print(" </td> \n"); print(" </tr> \n"); print("</table> \n"); print("</center> \n"); print("</form> \n"); print("</body> \n"); print("</html> \n"); ob_flush(); ?>
  21. whats the results of echo "<pre>"; print_r($data->bestPricesToLay->Price); print_r($data->bestPricesToLay->Price[0]); EDITED BY WILDTEEN88: Please use the code tags ( ) tags when posting code in posts. Thank you.
  22. What is or isn't it doing that you want or don't want it to do? Be more specific. We're programmers, not psychics. you sure your not psychic wildbug (coz i was just thinking that exact same thing)
  23. Use code tags check comments in code <html> <head> <title>Add An Article</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .box { font-family: Arial, Helvetica, sans-serif; font-size: 12px; border: 1px solid #000000; } --> </style> </head> <body> <?php require_once('db.inc.php'); if(isset($_POST['save'])) { $title = $_POST['title']; $content = $_POST['content']; $image = $_POST['image']; if(!get_magic_quotes_gpc()) { $title = addslashes($title); $content = addslashes($content); $image = addslashes($image); } $query = "INSERT INTO events (title, content, image) VALUES ('$title', '$content', '$image')"; mysql_query($query) or die('Error ,query failed'); echo "Article '$title' added"; } ?> <form method="post"> <table width="700" border="0" cellpadding="2" cellspacing="1" class="box" align="center"> <tr> <td width="100">Title</td> <td><input name="title" type="text" class="box" id="title"></td> </tr> <tr> <td width="100">Content</td> <td><textarea name="content" cols="50" rows="10" class="box" id="content"></textarea></td> </tr> <tr> <td width="100"> </td> <td><input type="file" name="imagefile"> <br> <input type="submit" name="Submit" value="Submit"> <?php if(isset( $Submit )) { //If the Submitbutton was pressed do: if ($_FILES['imagefile']['type'] == "image/jpg"){ //<--- Note the type (check the change below and post the error) copy ($uploaddir.$_FILES['imagefile']['tmp_name'], "files/".$_FILES['imagefile']['name']) or die ("Could not copy"); echo ""; echo "Name: ".$_FILES['imagefile']['name'].""; echo "Size: ".$_FILES['imagefile']['size'].""; echo "Type: ".$_FILES['imagefile']['type'].""; echo "Copy Done...."; } else { echo "<br><br>"; echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['type'].")<br>"; //<--Note change from name to type } } ?></td> </tr> <tr> <td colspan="2" align="center"><input name="save" type="submit" class="box" id="save" value="Save Article"></td> </tr> </table> </form> </body> </html> post new error
  24. I agree with frost but if its a pure HTML page then try this <HTML> <HEAD> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="-1"> </HEAD> <BODY>
×
×
  • 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.