Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Post the code...
  2. The errors has nothing to do with register_globals. This line: define('DIR_DOCUMENT_ROOT', $HTTP_SERVER_VARS['DOCUMENT_ROOT']); should be: define('DIR_DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT'] . 'flbiz/');
  3. I suggested a fix earlier: Change: //Delete all stickied news if(isset($_POST['delete']['s'])) to //Delete all stickied news elseif(isset($_POST['delete']['s']))
  4. The install log means nothing. Have you restarted Apache since installing php? What happens if you go to http://localhost
  5. How are you accessing the file? Post the url you are using. Also where are you saving the phpinfo.php script to?
  6. Make sure the mod_rewrite module is loaded in your httpd.conf file.
  7. I have merged your two topics together and attached your httpd.conf/php.ini files. What error? Please post more info.
  8. I cant remember the exact steps. You'll need to open Dreamweaver's Preferences (Edit > Preferences). Find the syntax highlighter section and select the PHP option from the menu and you can change the font their.
  9. Did you not read this point made by johnpain123: This is probably because when you first installed Apache you set the Network Domain to mydomain.net. As this address does not exist yet Apache cant establish the ip address the domain belongs to. Apache will fall back to the ip address of the computer it is installed on instead. You can ignore the error, however for now I'd recommend you to open your httpd.conf file and find the following line: ServerName mydomain.net:80 and change it to: ServerName localhost:80 Save the httpd.conf and restart Apache. You will need to install PHP yes. Read the instructions in this post for setting up PHP with Apache on Windows. The install video you watch to install Drupal most probably used an FTP client to upload the Drupal script to their website. As you have AMP installed locally you do not need to use FTP. You just download Drupal, extract the contents of the .tar.gz file (using winRAR) to Apaches htdocs folder (C:/path/to/Apache/htdocs). Open your browser and go to http://localhost/drupal-folder/install.php and the install script should appear. You should read the drupal docs
  10. Well sessions use cookies but not in the same way. It uses a cookie to set what is known as the session identifier all session data is then stored server-side. Sessions are more secure than cookies. Example basic usage of sessions: <?php session_start(); // this must be called on ALL pages which use sessions // set a session variable $_SESSION['test'] = 'hello'; ?> <a href="sess_test.php">Retrive session data</a> <?php session_start(); echo $_SESSION['test']; ?> Run sess_init.php then click the link to sess_test.php
  11. Sessions are domain specific (I heard) and it's a subdomain. Sessions can work over subdomains. Make sure session.cookie_domain is set to .domain.com (NOTE: the . at the beginning is important).
  12. Add <?php error_reporting(E_ALL); ini_set('display_errors', 'on'); ?> to the top of your script. Rerun the script and errors should be displayed.
  13. Change the order of the fields in the ORDER BY clause to: $query1 = "SELECT * FROM news ORDER BY sticky, id ASC"; should do the trick.
  14. It is to do with the HTML code. Change the HTML to how you want the news to appear To always align news title text to the left. Change: <th>{$sticky}<u>{$news['title']}</u></th> to <th align="left"><u>{$sticky}{$news['title']}</u></th>
  15. Change: //Delete all stickied news if(isset($_POST['delete']['s'])) to //Delete all stickied news elseif(isset($_POST['delete']['s'])) What spaces? 3.) ???
  16. You're still using the old queries which are wrong. News.php should be: <?php require('config.php'); // Make a MySQL Connection mysql_connect("$path", "$username", "$password") or die(mysql_error()); mysql_select_db("$database") or die(mysql_error()); if(isset($_POST['postnews'])) { $title = mysql_real_escape_string($_POST['title']); $news = mysql_real_escape_string($_POST['news']); //Check thate status of the sticky radio button $sticky = (isset($_POST['sticky']) && $_POST['sticky'] == 'y') ? 'y' : 'n'; //Insert the news $query = mysql_query("INSERT INTO news (title, news, sticky) VALUES ('$title', '$news', '$sticky')") or die(mysql_error()); echo "<meta http-equiv='refresh' content='1'> News posted!"; } elseif(isset($_POST['delete'])) { //Delete all non-sticky news if(isset($_POST['delete']['r'])) { $qry = 'DELETE FROM news WHERE sticky=\'n\''; $msg = 'All <b>non-stickied</b> news deleted!'; } //Delete all stickied news if(isset($_POST['delete']['s'])) { $qry = 'DELETE FROM news WHERE sticky=\'y\''; $msg = 'All <b>stickied</b> news deleted!'; } //Delete all news else { $qry = 'TRUNCATE TABLE news'; $msg = 'All news deleted!'; } mysql_query($qry)or die(mysql_error()); echo "<meta http-equiv='refresh' content='1'> $msg"; } else { ?> <title>Add/Delete Recent News</title> <a href="../">Click Here to go home.</a> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post"> <p>Title:<br> <input type="text" name="title" /></p> <p>Text:<br> <textarea rows="10" cols="50" name="news"></textarea></p> <p>Sticky: <input type="radio" name="sticky" value="y" /> YES | <input type="radio" name="sticky" value="n" /> NO</p> <input type="submit" name="postnews" value="Post News"> </form> </form> <br><br> <h4>Options:</h4> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post"> <input type="submit" name="delete" value="Delete All News"> <input type="submit" name="delete[r]" value="Delete Non-Sticky News"> <input type="submit" name="delete[s]" value="Delete Sticky News"> </form> <u>Current features:</u> <br> <i>Quick Post News <br> Delete all regular news with one click <br> Delete all stickied news with one click <br> Option to title your news <br> "Sticky" News <br> Neatly displays all posted news in order from sticky to regular</i> <br><br><br> <u>Coming soon:</u> <br> <i>Ability to edit news <br> Ability to make stickied news regular and vise versa</i> <?php } ?>
  17. if(!empty(trim($variable16))) { echo "<pMeeting Time: $variable16</p>"; } You should give your variables meaningful names. Don't let dreamweaver name them for you.
  18. good point, forgot about that part.
  19. Use a foreach loop foreach($_POST as $field_name => $field_value) { if(empty($_POST[$field_name]) || !is_numeric($_POST[$field_name])) { $error[$field_name] = 'error message here' } } if(isset($error) && is_array($error)) { // display error here }
  20. to login to mysql after a fresh install you'd use the username root with no password (leave the password field blank if it prompts for it). You can always reset the password if you don't know it.
  21. You can use SUM(liters , mpg) as total maybe
  22. Can you post the code here along with the errors messages in full. I have tested my code for syntax errors and even set-up a temporary news table like yours, to see if the code works correctly. Which it does from my testing. You tried clearing your browsers cache?
  23. Are you wanting your computer to be accessible from the internet, by mydomain.net if so you don't need to add mydomain.net to the host file or name your computer johnpain123. The network domain and the Server Name field should be mydomain.net To add your computer to the internet sign up to dyndns.org or no-ip.com (you may have to pay a subscription fee to use your own domain name). Once everything is setup you should be able to access your computer via your domain. Note: Make sure your firewall excepts external connection to port 80. You will also need to port forward port 80 if you're behind a router.
  24. Remove mysite\.com/ from the rewrite rule. You don't need to include your domain in the rewrite rule
×
×
  • 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.