Jump to content

Philip

Staff Alumni
  • Posts

    4,665
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by Philip

  1. Well, what I meant by the books was like what you said - where we could sell the ones we recommend and the ones that people at this site have written. I don't think I was clear when I replied, sorry :(
  2. Would this include books, like a list of PHP tutorials or code books. I dunno, was just wondering.
  3. If you're wanting to find a CMS program, take a look at the links here: http://en.wikipedia.org/wiki/Content_management_system#External_links (look in the directories to find one that suits your needs)
  4. well, there are a few things wrong with your function. here is a fixed version: [code] <?php function check_email($email) { $check_email = mysql_query("SELECT * FROM users WHERE email = '$email'"); // select rows where email = email $numb_email = mysql_num_rows($check_email); //how many rows match the email if ($email > 0) { $reason = "-The email address is already in use with another account sorry.<br />"; header("Location: index.php?page=register&reason=$reason"); } else { return $email; } } ?>  [/code] Then to call the function, use: [code] <?php $email = 'test@mydomain.com'; //set variable - you would use the user input from the form check_email($email); //run function ?>[/code]
  5. Well, I've been looking around, and I think it has actually gotten taken off. On Chronicles of War, we haven't upgraded the forum system, and it was a default option. I think they might have gotten rid of it :( Ex: http://www.livedemo.com/scripts/smf/ or http://chroniclesofwar.com/forum/ they have it, but they are older forum systems. Oh well, it was worth a shot.
  6. Well, I'm talking about for each member, like: http://www.phpfreaks.com/forums/index.php?action=profile;u=22649;sa=statPanel
  7. You might want to try these boards instead: http://www.phpfreaks.com/forums/index.php/board,7.0.html
  8. http://www.phpfreaks.com/forums/index.php/topic,58799.0.html Take a look at that -- there might be a few for you :D
  9. Glad to help :D
  10. Timeout is set in your PHP settings - I'm not too familiar with how to get to them - but I will look it up If you are using sessions on all the pages, then yes, put session_start(); on all of the pages :D
  11. Make sure to have session_start(); on [b]every[/b] page you use your sessions. This should fix the problem. and as for [code]header('Location:..'.$pg);[/code] -- if you have $pg = $_GET['pg'];. then yes it is correct
  12. Try: [code]<?php $path = "http://www.mydomain.com/"; include($path.'test.php'); ?>[/code]
  13. well, if you use the $pagecode = "?> ... <?"; - it will show the php tags: [code]<?php $pagedata = " ?> <b>hi</b> <?php "; echo $pagedata; ?>[/code] has an output of: ?> [b]hi[/b] -- Thats why I wouldn't bother putting in the ?> <? tags, there is no need for them.
  14. [code] <?php $id = "1" ; $title = "Main Page" ; $restricted = "0 " ; $keywords = "home page main " ; $type = "1" ; $pagecode = "<lots of HTML>"; ?> [/code] if you do it that way, make sure to not have any double quotes
  15. The include() function produces a Warning while require()  results in a Fatal Error. In other words, use require() if you want a missing file to halt processing of the page. include() does not behave this way, the script will continue regardless. The require_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the require() statement, with the only difference being that if the code from a file has already been included, it will not be included again. --Taken from the PHP manual
  16. Possibly have a contact form on the "find us" page - easier on the user. Also, I would have the top image (the one above the menu) as a link to the home page. Otherwise looks fine :)
  17. Try: [code]<?php echo "<p>Vender: <a href='http://".$row_get_gifts['vender_webpage']."'>".$row_get_gifts['vender']."</a></p>"; ?>[/code]
  18. why is there a [/url] instead of a </a> ? Ah, the forums do that -- is the [/url] a < /a>?
  19. The following code is from http://www.devpapers.com/article/41 (check there if you want a little more explanation of the coding) Should be exactly what you need :D form.php [code] <form action="upload.php" method="post" ENCTYPE="multipart/form-data"> File: <input type="file" name="file" size="30"> <input type="submit" value="Upload!"> </form> [/code] upload.php [code] <?php // ============== // Configuration // ============== $uploaddir = "uploads"; // Where you want the files to upload to - Important: Make sure this folders permissions is 0777! $allowed_ext = "jpg, gif, png, pdf"; // These are the allowed extensions of the files that are uploaded $max_size = "50000"; // 50000 is the same as 50kb $max_height = "100"; // This is in pixels - Leave this field empty if you don't want to upload images $max_width = "100"; // This is in pixels - Leave this field empty if you don't want to upload images // Check Entension $extension = pathinfo($_FILES['file']['name']); $extension = $extension[extension]; $allowed_paths = explode(", ", $allowed_ext); for($i = 0; $i < count($allowed_paths); $i++) { if ($allowed_paths[$i] == "$extension") { $ok = "1"; } } // Check File Size if ($ok == "1") { if($_FILES['file']['size'] > $max_size) { print "File size is too big!"; exit; } // Check Height & Width if ($max_width && $max_height) { list($width, $height, $type, $w) = getimagesize($_FILES['file']['tmp_name']); if($width > $max_width || $height > $max_height) { print "File height and/or width are too big!"; exit; } } // The Upload Part if(is_uploaded_file($_FILES['file']['tmp_name'])) { move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']); } print "Your file has been uploaded successfully! Yay!"; } else { print "Incorrect file extension!"; } ?>[/code]
  20. You have to do: [code]<?php $updatewhat = "whateverpage"; $stats = "fullseason"; include('update.php'); ?>[/code] It is not possible to include files with the ?var=var - as PHP will look for the file update.php?updatewhat=what&stats=fullseason in the directory ;)
  21. Under the stats of a user, there is a section where it says "Most Popular Boards By Posts" and has the bars going out. On other SMF boards there is a number beside it saying how many posts are in each of those sections. Would be cool to see what the numbers are like. Thanks! KingPhilip Similar to: http://www.phpfreaks.com/forums/index.php?action=profile;u=22649;sa=statPanel
  22. Try switching the if they all = any and the first expression you had. This way it checks to see if they all = any first, then if it doesn't it will run through the rest of them. [code]<?php $day=$_POST["day"]; $aircraft=$_POST["aircraft"]; $departure=$_POST["departure"]; $arrival=$_POST["arrival"]; if ($day == "Any" && $aircraft == "Any" && $departure == "Any" && $arrival == "Any") { echo 'Day, Aircraft, Departure, Arrival = Any'; } elseif ($day == "Any") { echo 'Day = Any'; } elseif ($aircraft == "Any") { echo 'Aircraft = Any'; } elseif ($departure == "Any") { echo 'Departure = Any'; } elseif ($arrival == "Any") { echo 'Arrival = Any'; } ?>[/code]
  23. http://dhtmlnirvana.com/ajax/ajax_tutorial/ It has 2 different types of image galleries.
  24. I would recommend using Javascript, AJAX, or flash to do this.
  25. This should work :) [code]<?php $day=$_POST["day"]; $aircraft=$_POST["aircraft"]; $departure=$_POST["departure"]; $arrival=$_POST["arrival"]; if ($day == "Any") { echo 'Day = Any'; } elseif ($aircraft == "Any") { echo 'Aircraft = Any'; } elseif ($departure == "Any") { echo 'Departure = Any'; } elseif ($arrival == "Any") { echo 'Arrival = Any'; } elseif ($day == "Any" && $aircraft == "Any" && $departure == "Any" && $arrival == "Any") { echo 'Day, Aircraft, Departure, Arrival = Any'; } ?>[/code]
×
×
  • 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.