Jump to content

jamesreno20

New Members
  • Posts

    9
  • Joined

  • Last visited

jamesreno20's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. > So i am trying to get it run a ui slider but iv never done anything with jquery before so was unsure how to do it i cant get this to work and was wondering if someone could help me do it <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <link rel=stylesheet type="text/css" href="css.css" > </head> <body> <Nav> <li><a class="active" href="home.html">Home</a></li> <li><a href="roster.html">Roster</a></li> <li><a href="events.html">Events</a></li> <li><a href="history.html">History</a></li> <li><a href="training.html">Training</a></li> <li><a href="news.html">News</a></li> <li><a href="about.html">About</a></li> </nav> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> link rel="stylesheet" type="text/css" href="style/slider.css" /> <script type="text/javascript" src="js/slider.js"></script> <div class="container"> <div class="captions"> <div class="caption" name="c0"> <p>Caption 1</p> </div> <div class="caption" name="c1"> <p>Caption 2</p> </div> <div id="buttons"> <div id="left" value="left" onClick="show_previous()"></div> <div id="right" value="right" onClick="show_next()"></div> </div> </div> <div class="slider"> <div class="slide" name="0" style="background-image:url(Theacademy.jpg)"></div> <div class="slide" name="1" style="background-image:url(britishwrestling/2.jpg)"></div> </div> </div> </body> </html>
  2. i need the numbers to be input from the user do you know how to do this
  3. hi im trying to use query to select from a table where the price is between to values that the user has to input such as min of 3 and max of 8 and return all the fields from the database where it is true im unsure how to do this but this is what i have so far $res = pg_query ($conn, "SELECT ref,artist,composer,genre,title,album,label,price,description FROM music WHERE price = < && > "); echo "<table border='1'>"; echo "<tr><th>Select</th><th>Artist</th><th>Composer</th><th>Genre</th><th>Title</th><th>Album</th><th>Label</th><th>Price</th><th>Description</th></tr>";
  4. i have checkboxes on the database page and if checked they send to the shopping basket i have the items selected to display but like this Array ( [0] => Imagine DragonsImagine DragonsRockI Bet My LifeKIDinaKORNER1.25Brand new single from the incredible Imagine Dragons ) i want it to be like this Imagine Dragons Imagine Dragons Rock I Bet My Life KIDinaKORNER 1.25 Brand new single from the incredible Imagine Dragons here is my code ____________________________________________________________________ database.php <form name="test" method="post" action="shoppingbasket.php" > $res = pg_query ($conn, "SELECT ref,artist,composer,genre,title,album,label,price,description FROM music"); echo "<table border='1'>"; echo "<tr><th>Select</th><th>Artist</th><th>Composer</th><th>Genre</th><th>Title</th><th>Album</th><th>Label</th> <th>Price</th><th>Description</th></tr>"; while ($row = pg_fetch_row($res)) { echo "<tr>"; echo '<td><input type="checkbox" name="check_list[]" value="'. $row[1]. $row[2]. $row[3].$row[4].$row[5].$row[6].$row[7].$row[8].$row[9].'"></td>'; for ($column = 1; $column < pg_num_fields($res); $column++) { echo "<td>" . $row[$column] . "</td>"; } echo "</tr>"; } echo "</table>\n"; ?> <input type="submit" value="Submit" > __________________________________________________________________________- shppingbasket.php <?php print "<pre>"; print_r($_POST['check_list']); print "</pre>"; ?>
  5. i have checkbox in a table and want to put the value as the id in the database then when i press submit it displays all the row data for each checkbox $res = pg_query ($conn, "SELECT artist,composer,genre,title,album,label,price,description FROM music"); echo "<table border='1'>"; echo "<tr><th>Select</th><th>Artist</th><th>Composer</th><th>Genre</th><th>Title</th><th>Album</th><th>Label</th><th>Price</th><th>Description</th></tr>"; while ($row = pg_fetch_row($res)) { echo "<tr>"; echo '<td><input type="checkbox" name="check_list[]" value="' . $row['res'] .'"></td>'; for ($column = 0; $column < pg_num_fields($res); $column++) { echo "<td>" . $row[$column] . "</td>"; } echo "</tr>"; } echo "</table>\n"; ________________________________________________-- basket.php echo "<table border='1'>"; echo "<tr><th>Select</th><th>Artist</th><th>Composer</th><th>Genre</th><th>Title</th><th>Album</th><th>Label</th><th>Price</th><th>Description</th></tr>"; echo "<pre>\n"; print_r($_POST['check_list']); echo "</pre>\n";
  6. it doesnt ouput anything im not sure how you get the values from each row from teh checkbox to display to the basket
  7. so i have my database form which you can select a some data using the checkbox and when submitting it should get the row info and display it on the next page iv been struggling for days on this and cant work out how to do it please could i have some help <form name="test" method="post" action="shoppingbasket.php" > <input type="submit" value="Submit" > <?php $conn = pg_connect("host=db.dcs.aber.ac.uk port=5432 dbname=teaching user=csguest password=r3p41r3d"); $res = pg_query ($conn, "SELECT artist,composer,genre,title,album,label,price,description FROM music"); echo "<table border='1'>"; echo "<tr><th>Select</th><th>Artist</th><th>Composer</th><th>Genre</th><th>Title</th><th>Album</th><th>Label</th><th>Price</th><th>Description</th></tr>"; while ($row = pg_fetch_row($res)) { echo "<tr>"; echo '<td><input type="checkbox" name="check_list[]" value="' . $row['ref'] . $row['artist'] . '"></td>'; for ($column = 0; $column < pg_num_fields($res); $column++) { echo "<td>" . $row[$column] . "</td>"; } echo "</tr>"; } echo "</table>\n"; ___________________________________________________________________________________________________ shopping basket.php <?php echo "<table border='1'>"; echo "<tr><th>Select</th><th>Artist</th><th>Composer</th><th>Genre</th><th>Title</th><th>Album</th><th>Label</th><th>Price</th><th>Description</th></tr>"; if(!empty($_POST['check_list'])){ foreach($_POST['check_list'] as $row){ echo "$row was checked! "; } } ?> </form> </body> </html>
  8. database.php ________________________________________________________________________________________ $res = pg_query ($conn, "SELECT artist, composer, genre, title, album, label, price, description FROM music"); echo "<table border='1'>"; while($a = pg_fetch_array($res)){ echo "<td>" . $a['1'] . "</td>"; echo "<td>" . $a['2'] . "</td>"; echo "<td>" . $a['3'] . "</td>"; echo "<td>" . $a['4'] . "</td>"; echo "<td>" . $a['5'] . "</td>"; echo "<td>" . $a['6'] . "</td>"; echo "<td>" . $a['7'] . "</td>"; echo '<td><input type="checkbox" name="music[]" value="$ref"' . $row['0'] . $row['1'] . $row['2'] . $row['3'] . $row['4'] . $row['5'] . $row['6'] . $row['7'] . '"/></td>'; echo"</tr>"; } echo "</table>\n"; ?> _____________________________________________________________________________- shoppingbasket.php _____________________________________________________________________________- <form action="shoppingbasket.php" method="POST"> Send To Basket: <name="music"> <input type="submit" value="submit"> </form> cant get it to send data from database to this page shoppingbasket.php if(isset($_POST['music'])){ if (is_array($_POST['music'])) { foreach($_POST['music'] as $row){ echo $row; } } else { $row = $_POST['music']; echo $row; } }
  9. database.php $res = pg_query ($conn, "SELECT artist, composer, genre, title, album, label, price, description FROM music"); echo "<table border='1'>"; while($a = pg_fetch_array($res)){ echo "<td>" . $a['1'] . "</td>"; echo "<td>" . $a['2'] . "</td>"; echo "<td>" . $a['3'] . "</td>"; echo "<td>" . $a['4'] . "</td>"; echo "<td>" . $a['5'] . "</td>"; echo "<td>" . $a['6'] . "</td>"; echo "<td>" . $a['7'] . "</td>"; echo '<td><input type="checkbox" name="music[]" value="$ref"' . $row['0'] . $row['1'] . $row['2'] . $row['3'] . $row['4'] . $row['5'] . $row['6'] . $row['7'] . '"/></td>'; echo"</tr>"; } echo "</table>\n"; ?> <form action="shoppingbasket.php" method="POST"> Send To Basket: <name="music"> <input type="submit" value="submit"> </form> cant get it to send data from database to this page shoppingbasket.php if(isset($_POST['music'])){ if (is_array($_POST['music'])) { foreach($_POST['music'] as $row){ echo $row; } } else { $row = $_POST['music']; echo $row; } }
×
×
  • 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.