Jump to content

SofWare

Members
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

SofWare's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Please could you specify what you mean by the code doesn't load in the way you want.
  2. myfunc() would return true and $db and $_GET['code'] are the global variables. I agree with trq that all the code (e.g. creating the global variable $db) needs to be posted.
  3. See this page: http://www.tizag.com/mysqlTutorial/mysql-php-sql-injection.php
  4. A solution that finds the minimum number of points for all permutations is Kruskal's algorithm (which is based on the idea of removing potential lower paths). A sketch of the solution is below. Please look up Kruskal's algorithm to understand what I mean by a weighted graph and edge. Create a weighted graph where: * an edge of weight 1 is drawn between each of the drivers; * an edge whose weight is the number of points is drawn between the cars and the drivers (so there is an edge of weight 2 between driver_1 and car_14 in the example you gave above); * no edges are drawn between the cars. Then Kruskal's algorithm finds the minimum spanning tree of this which graph gives you your solution - it finds the smallest weight that connects all the drivers to cars (the minimum number of points) minus the weight required to connect the drivers (which is always 19). Please let me know if you would like php code for this.
  5. A simple solution would be to write a validate function in javascript that sets the values like "Required!" or "Please do not leave empty" before the form gets submitted to php.
  6. a.productId isn't null - it doesn't exist - which is why this method doesn't work.
  7. Php is being awkward for you :-) Or perhaps one of the previous if statements is false (so the php does not reach the file_exists if statement)?
  8. You might have solved his problem - the reason why his code wasn't working is that his brackets were in the wrong place. A php file containing only the following should work: <?php $temp = array(); for ($i = 1; $i < 11; $i++) { $temp[$i - 1] = $i; } $sum = array_sum($temp); echo $sum; ?>
  9. Here you are: <?php $query = mysql_query("SELECT ID FROM imageArt WHERE isActive='1'"); while($data=mysql_fetch_array($query)) { echo "<a href='view.php?ID=" . $data['ID'] . " rel='lightbox' title='my caption'><img src='view.php?ID=" . $data['ID'] . "' width='200' height='200'></a>"; } ?>
  10. Or pass it in by reference (then it doesn't need to be returned). However the answer he might be interested in is no - one cannot get a variable from another function without modifying the other function (e.g. by making it's variables global which might cause threading problems or passing in/returning variables). The variable scope link above probably explains everything.
  11. I haven't read his javascript in detail (so I won't get sued for using his function) but it does look like what he really needs to do is understand ajax to communicate with php and then he needs to understand how to save data to mysql using php - there are two different things he needs to understand.
  12. Near the bottom is the question :-) It says: wp_redirect( 'http://www.website.com/?s=[how to put the $search here]', 301 ); And for the answer, he should try: wp_redirect( 'http://www.website.com/search/' . $search, 301 );
  13. You might be able to change it by editing the CSS. Where would you like the link to be?
×
×
  • 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.