Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. The reason why you are getting the error message is becuase you are outputting something to the browser. You cannot use the header function if you have ouput before the use of header or anyother header style function such as setcookie, session_start etc. You can use the old html style which is a meta refresh instead.
  2. If you want to edit something in a file then you'll want to get the contents of the file, apply the changes and then rewrite the file. You will want to use fopen, fread, str/preg_replace or other functions and then fwrite and fclose.
  3. Unless he means error messages which he may define in his script such as someone didn't fill in required field in a form. If you are dealing with forms then javascript is the best tool as you can get javascript to check whether the user filled in the required fields with the correct data and prevent the form from submitting if it does have errors.
  4. Something like this: [code]<?php $array = array("hello", "world", "again"); // loop through array foreach($array as $key) {    // check that the current value $key is equal to the last value in the arrray     if($key == end($array))     {         echo "end of array! - " . $key . "<br />\n"; // end of array     }     else    {         echo "array is at key " . $key . "<br />\n"; // not end of array     } } ?>[/code]
  5. It just pays to spend that extra time searching around. But anyway no problem.
  6. Sure. Change this bit: [code]Print "<td><a href=\"pets.html\">".$row['pet'] . "</a></td></tr>";[/code]to [code]Print "<td><a href=\"" . $row['pet'] . ".html . "\">".$row['pet'] . "</a></td></tr>";[/code]
  7. You'll want to use ajax then. That way you can interact with PHP and Javascript simultaneously.
  8. You wont get any errors becuase your are suppressing them, as you have an @ symbol infront of your $_REQUEST['streamname'] variable, as seen below: [code]$streamname=@$_REQUEST['streamname'];[/code] When you remove the @ symbol you may get a notice message Also it appreas that you dont have a submit button in order to submit the form data. If you have nothing for submitting a form then your data will never be sent as you havnt told the browser to submit the form data.
  9. MediaWiki already has a couple of predefined scripts that can integrate MediaWiki with a couple of forums, such as phpBB, SMF, IPB etc [a href=\"http://meta.wikimedia.org/wiki/Category:Integration\" target=\"_blank\"]here[/a]
  10. You can use Javascript for that: [code]window.close[/code] You won't be able to do this in PHP, only javascript.
  11. You should add cury braces around your variables in a HEREDOC statement like so: {$_SERVER['PHP_SELF']} otherwise you'll get the error message you are curtrently getting. Wrapping curly brakets around a variable shows PHP where the variable starts and ends basically.
  12. Yes use the :hover persuado class. NOTE: currently IE6 doesn't support the :hover persuado class on any tag accept the anchor (a) tag, but IE7 now supports the :hover persuado class on any tag.
  13. I use a program called [a href=\"http://www.blumentals.net/rapidphp/\" target=\"_blank\"]Rapid PHP[/a]. It has full HTML/Javascript and CSS support and is designed towards developing PHP scripts and has an inbuilt PHP Syntax checker (requires the php intepreter to be installed on your computer) and syntax highlighting for a number of programming langauges. It costs a mear $30 ($29.85 to be exact). There is also another PHP editor I used to use which is called PHP Designer 2006 which is 100% free!
  14. I see the error now. Change this: [code]<?php virtual('/Connections/salford.php'); ?>[/code] to [code]<?php require_once('/Connections/salford.php'); ?>[/code]
  15. change the following: [code]Print "<th>Pet:</th> <td>".$info['pet'] . " </td></tr>";[/code] to: [code]Print "<th>Pet:</th> <td><a href=\"pets.html\">".$info['pet'] . "</a></td></tr>";[/code]
  16. There is usally a delay when sending an email with mail. Also check that your email client isn't putting your emails into the Junk/Spam folder.
  17. You have an error in your sql query that is why your are retrieving that error. So change the following: [code] $query = "SELECT category, model_number, quantity FROM models WHERE model_number=$id"; $result = @mysql_query ($query); if (mysql_num_rows($result) ==1){[/code]to[code] $query = "SELECT category, model_number, quantity FROM models WHERE model_number=$id"; $result = @mysql_query ($query) or die("Query error: <i>" . $query . "</i><br><br>" . mysql_error()); if (mysql_num_rows($result) ==1){[/code] When you run your edit script again PHP/MySQL will report a proper error message in the following format: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Query error: [i][query here][/i] [mysql error here][/quote]
  18. Well theres a clue in the error message. virtual is being called on line 1 in [b]dpage.php[/b]. If you post the code here we should be able to help. As far as I know virtual is used to include and parse shtml files and is an Apache specific function.
  19. Change the below code: [code]<? for($count = 0; $count < mysql_numrows($result); $count++) { ?><tr> <td><?echo mysql_result($result,$count,"code")?></td> <td><?echo mysql_result($result,$count,"name")?></td> <td><?echo mysql_result($result,$count,"price")?> USD</td> </tr> <? } ?>[/code] To the following: [code]<?php while($row = mysql_fetch_array($result)) { ?> <tr> <td><?php echo $row['code']; ?></td> <td><?php echo $row['name']; ?></td> <td>$<?php echo $row['price']; ?> USD</td> </tr> <?php } ?>[/code]
  20. If your POSTed data is having there quotes escaped (\" or \') then you PHP setup has magic quotes enabled which escapes quotes automatically for you. You can temporarly disable magic quotes for your script by adding the following to the top of your php script: [code]?<?php if (get_magic_quotes_gpc()) {     set_magic_quotes_runtime(0); } ?>[/code] That should temporarly shutdown magic quotes.
  21. Change your code to the following: [code]//PASSWORD VERIFICATION if (($pass)!=($pass2)) {     header("Redirect: 5; URL=error-pwverify.php"); //the user will be sent to this page after 5 secounds     die("The password you specified does not match the password set. Please try again.<br /><br />This page will be redirected in 5 secounds"); }[/code]
  22. What you will want to do is upon upload you will want chekc the database first to see if the picture file name is already in the database and if so just use the UPDATE statement or if the file doesn't exists use the INSERT statement intsead.
  23. The only way to convert a string into a timestamp (UNIX) is strtotime. MySQL supports UNIX timestamps.
  24. You'll want to download the [b]Windows Binaries[/b] Zipped package ([i]PHP 5.1.4 zip package [/i]) Onced downloaded extract the contents to C:\php Also in order to view you pages in a browser you will need Apache and possible MySQL too if your site uses a mysql database. Rather than downloading individual bits of software you might want to download a software package called [a href=\"http://www.wampserver.com/en/index.php\" target=\"_blank\"]WAMP[/a].
  25. Please do not most multiple instances of your problem around different forums. You already posted this in the [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=92935\" target=\"_blank\"]PHP Installation[/a] forum. Thread Closed.
×
×
  • 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.