Jump to content

Alex

Staff Alumni
  • Posts

    2,467
  • Joined

  • Last visited

Everything posted by Alex

  1. It would be nice if you could post the error so we can see where it's occurring.. You should also use php tags next time. edit: Does this look right to you? echo "$row2[friend]echo "<form method=post action=http://www.solent.edward.ac.uk/~FoshRachel/dissertation/otherprofile.php?friend=$row2[friend]><input name=Profile View input type=submit value=Go></form>";<br/>"; You can't combine two echos like that. echo "$row2[friend]<form method=post action=http://www.solent.edward.ac.uk/~FoshRachel/dissertation/otherprofile.php?friend=$row2[friend]><input name=Profile View input type=submit value=Go></form><br/>";
  2. This forum is for asking specific questions that can't be found by using Google.
  3. You're missing a pair of quotes. $query="select * from users where towncity= 'Maidenhead' and fname = '$search_text' or organisationname ='$search_text' or surname ='$search_text'";
  4. Something like this should be done in JavaScript.
  5. $last = end($images_new); echo $last['name'];
  6. $var++ will return the current value of $var then increment it. Use ++$var, which increments and returns the current value, to get the result you expect.
  7. There are PHP compilers that are capable of compiling PHP into standalone executables. One such compiler is Roadsend, this supports PHP GTK 1, but not PHP GTK 2. If your goal is to be able to distribute a single installation file for convenience there's no need to compile into a standalone executable. You can create a simple batch file to launch the program, and use any of the many free available programs to package it into a single setup file.
  8. You should never use PHP_SELF as a form action as it leaves you vulnerable to XSS attacks. Instead just write the name of the file.
  9. You shouldn't have quotes around it, you don't want a string, you want it to perform the mathematical operation. $dvd_cost = 15.00*$dvd_quantity;
  10. Anonymous functions aren't available until PHP 5.3.0, if you were writing that code for a system with PHP 5.3.0 or higher installed you might do it this way: list($date, $h_a, $w_l_t, $us, $them, $vs_team) = array_map( function($x){ return $x == null ? " " : $x; }, explode(",", $game_result) );
  11. empty returns true for 0, so compare it against null instead. list($date, $h_a, $w_l_t, $us, $them, $vs_team) = 'hi,ho,hl,0,hm,hn'; $arr = array_map( create_function( '$x', 'return $x == null ? " " : $x;' ), explode(",", $game_result) );
  12. You need to be more specific. Have you done any debugging that tells you where it's going wrong? The first thing that jumps out at me is that you're relying on register_globals which is depreciated and not suggested. $file = $_POST['FN'];
  13. Try: list($date, $h_a, $w_l_t, $us, $them, $vs_team) = array_map( create_function( '$x', 'return empty($x) ? " " : $x;' ), explode(",", $game_result) );
  14. In the database table for the articles you should have a column used to specifiy whether or not the article has been approved. Say, 0 for unapproved and 1 for approved. By default you can have this column set to 0. You can then create a simple page where you select all of the records from the database that are unapproved (approved = 0) so they can be approved by an administrator. The page that displays the articles would only select articles that have been approved.
  15. You need to use a where clause. Example: $sql="SELECT * FROM $tbl_name WHERE cat='general' ORDER BY fid";
  16. Why did you place the column names in quotes? That's not needed, perhaps you meant to use backticks (`)? Backticks aren't even required, and not suggested, unless you're using reserved words for your column names which you really shouldn't be doing in the first place.
  17. $_SERVER['REQUEST_TIME'] is a unix time stamp, as such you can format it using date.
  18. Your problem is that you're trying to access the members of the array as if it's a multidimensional array, which it's not. function convert_emoticons($textstring){ include("emoticons.php"); foreach($emoticons as $symbol => $filename) { $textstring = str_replace($symbol, '<img src="images/emoticons_' . $filename . '>', $textstring); } return $textstring; }
  19. You can mark the topic as solved by clicking the button to do so at the bottom of the page.
  20. If you're using Apache you can rename the file image.png and create a .htaccess file like this: <Files "image.png"> AddType application/x-httpd-php .png </Files> To have image.png parsed as a php file.
  21. Small typo on my part, sorry. <?php if($session->logged_in){ echo '<embed height="200" width="90%" src="http://en.gagalive.com/livechat2.swf?chatroom=leetgiveaways&user=' . $session->username . '"></embed>'; } else { echo '<embed height="200" width="90%" src="http://en.gagalive.com/livechat2.swf?chatroom=leetgiveaways"></embed>'; } ?>
  22. <?php if($session->logged_in){ echo '<embed height="200" width="90%" src="http://en.gagalive.com/livechat2.swf?chatroom=leetgiveaways&user=' . $session->usrername . '"></embed>'; } else { echo '<embed height="200" width="90%" src="http://en.gagalive.com/livechat2.swf?chatroom=leetgiveaways"></embed>'; } ?>
  23. You can't just place html anywhere. Just like you echoed 'hi' you needed to echo the html.
  24. Alex

    PayPal

    Single quotes don't have variable interpolation. echo '<input type="hidden" name="currency_code" value="' . $currency_iso_GBP . '">';
  25. Did you fix what Nightslyr added? <?php if($session->logged_in){ echo '<embed height="200" width="90%" src="http://en.gagalive.com/livechat1.swf?chatroom=LeetGiveaways"></embed>'; } else { echo "hi"; } ?>
×
×
  • 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.