Jump to content

WebStyles

Members
  • Posts

    1,216
  • Joined

  • Last visited

Everything posted by WebStyles

  1. Your question was: so yes, since you're only using the ID=1 to grab the results, the other variable is not doing anything.
  2. php manual says: do you have output before that code?
  3. it's working for me, check your browser. Maybe you don't have cookies enabled? my result: Array ( [tblog] => tblogvalue [sqliteManager_currentLangue] => 2 )
  4. then the category is not being used ?
  5. Not sure I get the question... simple html forms? <form name="something" action="processingPage.php" method="post"> Name: <input type="text" name="uName"> <input type="submit" value="SEND"> </form> grab variable on next page with: $name = $_POST['uName'];
  6. <?php $Month = 2592000 + time(); setcookie('tblog', 'tblogvalue', $Month); print_r($_COOKIE); ?>
  7. what I was asking, specifically, is how are you grabbing the url variables, and how are you querying the database.
  8. what details are still showing? how are you checking the fields? how are you retrieving them from database? *need to see more code* thanks
  9. 4 different options: include -- will include the file, and you can add it more times on same page require -- does the same but script will not continue if it cannot find the file include_once -- same as include but will only let you include it once, so no duplications occur require_once -- same as require, but also just once.
  10. Sure: html version: <div class="login"><a title="reg" href="<?php echo $reg;?>" target="_blank"></a></div> php version: echo '<div class="login"><a title="reg" href="'.$reg.'" target="_blank"></a></div>';
  11. Something else that might help: I don't know what system you're running, but if it's macintosh or unix/linux, grab a copy of webmin (it's free) and check out it's mysql server manager (under the servers tab), it's simpler than phpMyAdmin, so maybe you can get some ideas from it. p.s. I Totally agree with QuickOldCar. Databases first, then fields.
  12. change this: echo '.$reg.'; to: echo $reg;
  13. current month: $currentMonth = date("F"); current -1 month: $lastMonth = date("F",strtotime("- 1 month")); current -2 month: $monthBeforeLast = date("F",strtotime("- 2 months")); current -3 month $aLongTimeAgo = date("F",strtotime("- 3 months")); etc...
  14. They talk about it on php.net. json_decode
  15. why not create a function to handle the connections? function conn($database){ $server = '127.0.0.1'; $u = 'root'; $p = ''; $c = @mysql_connect($server,$u,$p); @mysql_select_db($database,$c); return $c; } call it with: $conn = conn('databasename'); use it as resource: $query = mysql_query("select * from whatever", $conn); close connection: @mysql_close($conn); keeps things nice and tidy.
  16. - On macintosh, with firefox, you're encoding is all messed up (you don't seem to have any in your online demo) - this is quite a basic piece of 'webware'. A lot to fix. I'm not sure if your demo is the fully working thing (if not it should be, otherwise we're all wasting time testing a thing that does not correspond to reality), but I'm getting a lot of bugs and errors. You don't seem to be detecting when a database is empty or not, you just spit out the fields. There's no button to add more data, no button to delete, etc.... I think, no matter how simple you would like it to be, what's going to happen is that you're going to start off with the absolute minimal functions, everyone is going to love it, because it only takes 2 minutes to learn, but then they'll need more features (been there, done that... hundreds of times)... So they will start to ask you to add stuff. As you do, they'll get increasingly happier... But in the end you're going to end up with something very similar to phpMyAdmin, the only difference is that everyone will know how to use it because they got to learn in increasing steps without being overwhelmed with all the features right from the start... Keep in mind that people only complain about and hate software they don't really know how to use. PhpMyAdmin is one of the easiest managers out there.
  17. to read data from a template and write it to another file, you could use something like: <?php // read data from the template: $template = file_get_contents('template.php'); // define name for new file $newFile = 'testing'.'.php'; // create new file and write data from template file_put_contents($newFile,$template); ?>
  18. try something like this: (change database field name first) <?php function checkActive() { $checkActiveQuery = mysql_query("SELECT * FROM `users` WHERE `user`= 'adf'"); $result = mysql_fetch_assoc($checkActiveQuery); $status = $result['field_name']; // SHOULD BE THE NAME OF THE DB FIELD THAT HOLDS THE VALUE 'BANNED', 'ACTIVE' or 'INACTIVE' if ($status == "INACTIVE"){ echo "Your account has not been activated. If you have not recieved, or have misplaced the activation email, please contact the administrator."; }elseif ($checkActiveQuery == "BANNED"){ echo "You have been banned from our social network. If you believe this is an error, please contact the administrator."; }else { echo "Your account is active."; } } ?>
  19. you're missing a semi-colon after: mysql_query("UPDATE members SET lastLogin='$lastLogin' WHERE uname='$name'") also, in this line: mysql_close($con); where does $con come from? you seem to be connecting to mysql without storing the resource in a variable (unless it's in uploader.php)... you're probably getting a warning about that, but you can surpress it with the @ sign (if you just want a quick fix to test things): @mysql_close();
  20. as a quick fix, you could store the orders in a temporary database, and upon successful payment, move them to a definitive one.
  21. when you submit that form, all inserted data will be contained in $_POST. Add something like this (just to see the result): if($_SERVER['REQUEST_METHOD']=='post'){ echo '<pre>'; print_r($_POST); echo '</pre>'; } you'll be able to see all submitted items and their names. then you access them individually, like this: imagine you have a field called 'username' echo $_POST['username']; if all you want to do is collect the data and email, you can do something like this: if($_SERVER['REQUEST_METHOD']=='post'){ $email = 'YOUREMAIL@YOURDOMAIN.COM'; $sub = 'submitted form'; $msg = ''; foreach($_POST as $k=>$v){ $msg .= $k .": ".$v."\n"; } mail($email,$sub,$msg); } hope this helps
  22. it all depends... are you expecting 1000 users per day (i.e. spread out through 10 to 12 hours), or at the same time? Anyway, files with 1000+ lines are not that easy to maintain, and a database is very easy to set up. If I were you, I'd create a database. Safer, easier and faster.
  23. don't worry, 1000 lines is nothing for a modern computer.
  24. I really don't know what you mean. Are you just trying to add an underscore between $a and $i ? then try this: <?php echo '<form id="form1" name="form1" method="post" action="try.php"> <table width="454" border="0"> <td width="153"> <label><input type="text" name="'.$a.'_'.$i.'" /></label></td> </td></tr></table></form>'; foreach($in = 1; $i <= 5; $i++) { $in[$a.'_'.$i] = $_POST[$a.'_'.$i]; } var_dump($in); ?>
×
×
  • 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.