Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. When the form is submitted what do you want to do with the checkboxes?
  2. The file that produces the WAMP homepage is index.php. if you wish to keep the homepage make sure you don't rename/delete or edit the contents of this file. However it is not required for WAMP to function correctly.
  3. In order for .htaccess to work you need to be using Apache as the HTTP server. You will also need to set the Options directive for your Document to atleast file within the httpd.conf Made sure you have enabled mod_rewrite within the httpd.conf too. To do so find the following line and remove the # at the start #LoadModule rewrite_module modules/mod_rewrite.so
  4. Post an example of your form here. Not quite understanding you fully from what you said above.
  5. Make sure you have set, session.save_path within the php.ini
  6. Use $contents = file_get_contents('your-file-with-codes.txt'); $codes = explode(',', str_replace(' ', ',', $contents));
  7. If you have named you checkbox as checkbox[] Then use $_POST['checkbox'][0] - first checbox $_POST['checkbox'][1] - secound checbox $_POST['checkbox'][2] - third checbox etc. You can easily loop through your checkboxes too, foreac($_POST['checkbox'] as $cbox) { echo $chox; }
  8. Use explode $contents = file_get_contents('your-file-with-codes.txt'); $codes = explode(',', $contents);
  9. This line: $news['news_body'] = nl2br($news['news_body']); Should be within then while loop <?php function printSticky($result1) { echo "<table>\n"; while($news = mysql_fetch_assoc($result1)) { $news['news_body'] = nl2br($news['news_body']); echo <<<HTML <span class="announcement">Announcement:</span> <b>{$news['news_title']}</b><br /> <hr width="300" align="left" /> {$news['news_body']} <br /> HTML; } echo "\n</table><br />"; } ?>
  10. Use the ORDER BY clause SELECT * FROM your_table ORDER BY productid DESC LIMIT 1
  11. It just constructs the $_POST array. r stands for room $r is the room id you pass to the function d, m and y stands for day, month and year so if you pass then function the room id of 101 it'll produce the following: <select name="r[101][d]"> ... </select> <select name="r[101][m]"> ... </select> <select name="r[101][y]"> ... </select>
  12. When you call the add_date_form you pass it the room id. To process the form, you'd use if(isset($_POST['submit'])) { foreach($_POST['r'] as $room_id => $date) { echo 'Date for room #'.$room_id.'<br />'. 'Day: '.$date['d'].'<br />'. 'Month: '.$date['m'].'<br />'. 'Year: '.$date['y']; echo '<hr />'; } }
  13. Something like <?php if(isset($_POST['submit'])) { echo '<pre>'.print_r($_POST, true).'</pre>'; echo '<hr />'; } function add_date_form($r) { $form = ''; $days = range(1,31); $months = range(1,12); $years = range(2009,2011); $form .= " <select name=\"r[$r][d]\"> <optgroup label=\"Day\">\n"; foreach($days as $d) { $form .= " <option value=\"$d\">$d</option>\n"; } $form .= " </optgroup>\n </select> <select name=\"r[$r][m]\"> <optgroup label=\"Month\">\n"; foreach($months as $m) { $form .= " <option value=\"$m\">$m</option>\n"; } $form .= " </optgroup>\n </select> <select name=\"r[$r][y]\"> <optgroup label=\"Year\">\n"; foreach($years as $y) { $form .= " <option value=\"$y\">$y</option>\n"; } $form .= " </optgroup>\n </select>\n"; echo $form; } echo "<form action=\"\" method=\"post\">\n"; for($i=1; $i<6; $i++) { echo " ROOM $i"; add_date_form($i); echo '<hr />'; } echo " <input type=\"submit\" name=\"submit\" value=\"Go\" /> </form>"; ?>
  14. What on earth are you trying to do. You're making no sense at all. Are you wanting your form to show the values selected when the form is submitted?
  15. When you echo out $links, remove the last 3 characters from the string with substr, example foreach($navigation as $link){ $links .= "<a href=\"".$link[1]."\">$link[0]</a> | "; } $links = substr($lines, 0, -3); echo $links;
  16. cell padding/spacing should only be set within the opening table tag. You cannot set cell padding/spacing within the TD tags. To space table rows out you should set cellspacing, eg echo "<table width='100%' border='0' cellspacing='10' cellpadding='0'>";
  17. You could use the variable, $_SERVER['HTTP_USER_AGENT'] . Which returns the webbrowsers version and OS the client is using.
  18. You can place a .htaccess file where your intranet only files are and place the following code within it Order Allow,Deny Allow 192.168.1 That will allow anyone with the internal ipaddress of 198.168.1.1 through to 198.168.1.255 access your intranet files. Manual on the Allow directive
  19. What OS are you using. What are you using MySQL for? There are many tutorials for installing MYSQL on the net. If you using Windows you can download the .msi installer and run through the prompts to install MySQL, as this tutorial shows. If you're using an *nix OS you can either compile MySQL yourself or install MySQL from your distributions software repositories.
  20. You cant do it with PHP alone you'll have to use some third party program for. Maybe ffmpeg maybe of use here
  21. As I see it, this is more of a CSS issue. You need to modify the css for your navigation menu. This: .nav li a { margin-top: 182px; Needs to be .nav li a { margin-top: 232px; You may need to adjust the margin slightly to your liking. This is just a rough guess whilst I was adjusting your css with the Firefox Web Development Tool Bar
  22. Not sure but maybe you could place your code within an infinty loop then add a sleep function, which will have the affect of running your script every ten seconds, example while(true) { // place your code here // pause script for 10 secounds sleep(10); } However for this to work you'll need to set max_execution_time to 0.
  23. You place your html within the quotes not outside of it $shoulder_array[0] = '<a href="http://www.muscleandstrength.com/exercises/military-press.html">Military press</a>'; // OR $shoulder_array[0] = "<a href=\"http://www.muscleandstrength.com/exercises/military-press.html\">Military press</a>";
  24. The only way you can do this is place all your classes within a dedicated folder. You'll then want to add this folder to PHP's include_path setting. So when ever you want to include a class you'd do include 'your_class.php'; rather than include 'path/to/your_class.php';
  25. Alternatively you could define a constant, say IN_APP within your main file: <?php define('IN_APP', true); include("config.php"); include("functions.php"); include("header.php"); include("somethingsub.php"); include ("footer.php"); ?> Now in config.php, functions.php, header.php, somethingsub.php and footer.php add the following after the opening PHP tag if(!defined(IN_APP)) die('Forbidden'); If either of the above files are requested separately a Forbidden message will be shown.
×
×
  • 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.