Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. WHat code are you using? In PHP its: $var += 1; Reading the documention will help you follow the correct syntax http://uk.php.net/manual/en/language.operators.assignment.php
  2. Install script of what kind? We need more info. What does you script do? What needs to be setup in order for your script to function correctly.
  3. Remove the @ symbols they are not needed.
  4. Your closing your if prematurely. This line $row = mysql_fetch_array( $result ); Should be after: $result = mysql_query("INSERT INTO `accounts` VALUES ('', '$user', '$pass2', '', '', '0', '9', '', '', 'flag', 'enUS', '0', null);") or die("Error: (" . mysql_errno() . ") " . mysql_error()); Like so if ($success) { echo "Valid New Account Entry<br />"; $result = mysql_query("INSERT INTO `accounts` VALUES ('', '$user', '$pass2', '', '', '0', '9', '', '', 'flag', 'enUS', '0', null);") or die("Error: (" . mysql_errno() . ") " . mysql_error()); $row = mysql_fetch_array( $result ); }
  5. What is line 96 in register.php? Post lines 90 to 100 here. That error is normally produced when a query fails.
  6. This is incorrect: isset checks for variable existence. You telling PHP to check to see if the variable $row exists. As you have defined it in the line above it'll always return true. What you should of done is use mysl_num_rows to check to see if any results where returned from your query if(mysql_num_rows( $result ) > 0) { $problemMessage .= "The username already exists <br />"; $success = false; }
  7. The \n is a visual representation of a newline. nl2br converts these characters into line break tags ( <br /> ). However nl2br will not remove these characters. The true problem actually lies within your JavaScript. Escape characters such as \n only work within double quotes, not single quotes. You should use the following instead when defining your maker variable var marker = createMarker(point,"<div style=\"width:400px height:450px\"><?php echo $loc; ?><br><?php echo nl2br($description); ?><br><?php echo $street; ?><br><?php echo $city; ?><br><?php echo $state; ?> <?php echo $zip; ?><br><?php echo $phone; ?><br><b>Start: </b><?php echo $start; ?><br><b>End: </b><?php echo $end; ?><br></div>");
  8. session_register should only be used when register_globals is enabled. When its disabled you use the $_SESSION superglobal variable for reading/writing to your session. <?php // when dealing with session always call session_start() session_start(); // assign new session variables $_SESSION['my_var1'] = 'new value'; $_SESSION['my_var2'] = 'another value'; ?> Now to retrieve your session variables you use. <?php // again make sure you call session_start() when using $_SESSION variables session_start(); // assign new session variables echo 'SESSION Vars:<br />'; echo 'my_var1 = "'$_SESSION['my_var1'] . '"<br />'; echo 'my_var2 = "'$_SESSION['my_var2'] . '"<br />'; ?> Do note the $_SESSION supergloabl is case-sensitive just like $_POST, $_GET and $_COOKIE etc
  9. [quote author=jackpf link=topic=54859.msg1176080#msg1176080 date=1241422904] I had a go with net beans...didn't care for it. I find it annoying the way it will autocomplete a quote for you, but it won't put the semicolon on the end. That means you just have to navigate around to append the semicolon. It probably would have been faster if I just typed the extra quote myself tbh. [/quote] Or just press the End key or right arrow key.
  10. strtotime returns a unix timestamp, which is the number of seconds passed since 1st Jan 1970. You'll need to use date to convert the timestamp into a readable date (as I have done in my code examples).
  11. You should use elseif not elsehere else ($unit == 'Hour' && $quantity >= 1 && $quantity <= 7)
  12. You wont need to do that long if/elseif block you'd do it like this if ($unit == 'Day' && $quantity >= 1 && $quantity <= 7) { $d = (int) $quantity; $end_date = strtotime("+$d Days", strtotime($start_date)); } For time it'll be similar to doing the date. $start_date = '02/21/2010 9:45:30'; $end_date = strtotime("+2 Hours", strtotime($start_date)); echo 'Start Date: '.date('D j M Y G:i:s', strtotime($start_date)) .'<br />'; echo 'End Date: '.date('D j M Y G:i:s', $end_date);
  13. If im not mistaken but status cannot equal read and unread at the same time. Your query should be $query = $db->execute("select `msg`, `status` from `user_log` where AND `player_id`=? AND `status` = 'read' OR `status` = 'unread' order by `status` desc", array($player->id));
  14. You'll run a SHOW TABLES mysql query
  15. You can do this with strtotime. However your date will need to be in US English format mm/dd/yyyy for it to work. $start_date = '02/21/2010'; $end_date = strtotime("+2 Days", strtotime($start_date)); echo 'Start Date: '.date('D j M Y', strtotime($start_date)) .'<br />'; echo 'End Date: '.date('D j M Y', $end_date);
  16. Yes wait for Windows 7, alot better than Vista IMO. However on 5th May you can get Windows 7 RC which can use for free for a year.
  17. For starters you code makes no sense. You're trying to to add a string and integer together which you cannot do (highlighted in red) Also the code in orange does not make sense either. You need to explain what you're trying to do here, as what you're currently doing is wrong
  18. if you are retrieving more than one row from the query you'll need to loop through the results. // loop through the results while($row = mysql_fetch_assoc( $result )) { echo "Name: ".$row['name']; echo " Question: ".$row['question']; echo " Email: ".$row['email']; }
  19. What service are you restarting in your restart.bat? WAMP sets up a service called wampapache
  20. What editor are using to create the file with?
  21. Replace what exactly? A file with the same name? You need to be more specific and post your code that you're having issues with.
  22. What have you saved the file as. Make sure you have saved it with a .php file extension, eg filename.php. By default PHP is only parsed within .php files. The file should also be placed within XAMPP's htdocs folder (eg C:/xampp/htdocs) You should also be going to http://localhost to run your .php files.
  23. mod_rewrite will not rewrite urls already within a webpage. You have to modify your urls manually.
  24. The location of the cookie is different depending on the browser you're using. IE stores all cookies in the Temporary Internet Files folder (can be accessible by Tools > Internet Options > Browsing History > Settings > View Files). IE stories cookies as text files in this format: cookie:<windows_username>@<sitename.com> To see how cookies are stored in other browsers you'll have to consult their documentation. Most modern browsers allow you to browse cookies from their settings manager.
  25. I think you confusing yourself here. HTML doesn't inherit file paths from PHP. With HTML all file paths will be relative to the url, not where your PHP file is located on the file system.
×
×
  • 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.