Jump to content

WebStyles

Members
  • Posts

    1,216
  • Joined

  • Last visited

Everything posted by WebStyles

  1. instead of var_dump, $result = checkLicense($licensekey, $url); will store the value in the variable $result.
  2. I'm not quite sure I understand the question correctly (do you want to create an index called 'attributes' inside the game array and put the players in there, or just add the players array as one of the game attributes?). But here's an example, and from this you can figure it our easily. $index = 0; // created a variable to keep track of the index number while($k = $db->fetch_array($db)) { $result[$index]['game'] = $k; // using $index number so I can keep track, and added 'game' $pm = new playersManager(); $players=$pm->get_players($k['id']); $result[$index]['players'] = $players; // dumped players in same index as the game data $index++; // increment index number } Hope this helps
  3. if the purpose is just eliminating the notices (and the script can run without the existence of that variable) then you can use something like: if( isset($order_by) && $order_by == "rate3asc" ){ instead of if( $order_by == "rate3asc" ){ But that would be redundant because you would be checking if the variable existed several times. You could wrap the whole thing in an if statement so you check just once: <?php if( isset($order_by) ){ if($order_by=="rate3asc"){ echo"Sorted by Lowest Price First"; } if($order_by=="rate3desc"){ echo"Sorted by Highest Price First"; } if($order_by=="newest"){ echo"Sorted by Recently Added Properties First"; } if($order_by=="bedsasc"){ echo"Sorted by Least Bedrooms First"; } if($order_by=="bedsdesc"){ echo"Sorted by Most Bedrooms First"; } } ?> But it's still not the best way. You could also use a switch statement, or even something like this (I would do this last one, as it allows to easily add or remove stuff from the array, and makes it easy to see all the available options): <?php $sortOrder = array( "rate3asc" => "Lowest Price First", "rate3desc" => "Highest Price First", "newest" => "Recently Added Properties First", "bedsasc" => "Least Bedrooms First", "bedsdesc" => "Most Bedrooms First" ); if( isset($order_by) ){ echo 'Sorted by '.$sortOrder[$order_by]; } ?> Hope this helps
  4. Don't worry, your english is great. You're a software developer? What languages? If you're going to get a freelancer, don't worry about giving him an example of a login script, he'll know how to do it 10 times better than those examples (I only looked at 3 of them, and all 3 had security issues)
  5. The answer to your question is: Yes, it's possible. If you're going to do it yourself, I can tell you right now your in for quite a long ride, since you have no knowledge of php. I suggest you hire someone to do it for you. Maybe have a look in the freelancer section of this forum and see who's available...
  6. Try this. Just briefly skimmed through it and changed a couple of things (explained below) <?php //RENDERING CART % Display Settings $cartOutput = ""; $cartTotal = ""; $pp_checkout_btn = ''; $product_id_array = ''; if(!empty($_SESSION["cart_array"])){ $cartOutput = "<h2 align='center'>Your shopping cart is empty</h2>"; } else { // Start PayPal Checkout Button $pp_checkout_btn .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="upload" value="1"> <input type="hidden" name="business" value="you@youremail.com">'; // Start the For Each loop $i = 0; foreach ($_SESSION["cart_array"] as $each_item) { $item_id = $each_item['item_id']; $sql = mysql_query("SELECT * FROM products WHERE id='$item_id' LIMIT 1"); $prod = mysql_fetch_assoc($sql); // Dynamic Checkout Btn Assembly $x = $i + 1; $pp_checkout_btn .= '<input type="hidden" name="item_name_' . $x . '" value="' . $prod['product_name'] . '"> //ERROR HERE FOR PRODUCT NAME <input type="hidden" name="amount_' . $x . '" value="' . $prod['price'] . '"> //ERROR HERE WITH PRICE VAR <input type="hidden" name="quantity_' . $x . '" value="' . $each_item['quantity'] . '"> '; // Create the product array variable $product_id_array .= "$item_id-".$each_item['quantity'].","; // Dynamic table row assembly $cartOutput .= '<div style="float:left;width:89%"> <form action="view_cart.php" method="post"> <input name="quantity" type="text" value="' . $each_item['quantity'] . '" size="1" maxlength="2" /> <input name="adjustBtn' . $item_id . '" type="submit" value="change" /> <input name="item_to_adjust" type="hidden" value="' . $item_id . '" /> </form> X <span>' . $prod['product_name'] . '</span> //ERROR HERE FOR PRODCT NAME VAR </div> <div style="float:right;width:10%;text-align:center;"> <form action="cart.php" method="post"><input name="deleteBtn' . $item_id . '" type="submit" value="X" /><input name="index_to_remove" type="hidden" value="' . $i . '" /></form> </div> '; $i++; } // Finish the Paypal Checkout Btn $pp_checkout_btn .= '<input type="hidden" name="custom" value="' . $product_id_array . '"> <input type="hidden" name="notify_url" value="https://www.yoursite.com/storescripts/my_ipn.php"> <input type="hidden" name="return" value="https://www.yoursite.com/checkout_complete.php"> <input type="hidden" name="rm" value="2"> <input type="hidden" name="cbt" value="Return to The Store"> <input type="hidden" name="cancel_return" value="https://www.yoursite.com/paypal_cancel.php"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="currency_code" value="USD"> <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - its fast, free and secure!"> </form>'; } ?> changed this: if (!isset($_SESSION["cart_array"]) || count($_SESSION["cart_array"]) < 1) { to this: (for the sake of simplicity. It does the same as your code) if(!empty($_SESSION["cart_array"])){ I changed your database query results to $prod and removed the while loop (why loop through results if you know there's only 1 sinceyou have LIMIT 1 on your statement)? changed your variables, since the results of the query are now stored in the variable I called $prod (I'm assuming your table 'products' has a field called 'product_name' and another called 'price') Why use SELECT * if you only need 2 fields? Test it now, and let me know. Hope this helps
  7. P.S. Why are you doing this $_POST["SearchPostCode"] = $SearchPostCode; // Why are you assigning a value to $_POST like this? // further down... if (isset($_POST['selectpropertybtn'])) { $_POST['selectedProductIDS']; // what's this supposed to do? {
  8. change this echo "<input id='addEmployeeID' type='number' name='$addEmployeeID' required /><br>"; to this echo "<input id='addEmployeeID' type='number' name='addEmployeeID' required /><br>"; (changed name). I didn't read through all your code, but saw this and saw you were trying to grab $_POST['addEmployeeID'] further down, so I'm guessing that's the problem.) hope this helps
  9. Just changed your email to mine and I got it in my gmail account (in spam folder because this server I'm using does not have a qualified domain associated, but nonetheless, email was sent.)
  10. are you sure? not even in your spam folder? The mail is not held up in my mail queue. It left my server. (I'm assuming the email address you have in your script is correct)
  11. did you get an email when I tested on my server with the following information? Name: peterEmail: peter@domain.comOther Contact Info: noneClass A Widgets: (1 * 1.25) = 1.25Class B Widgets: (3 * 2.35) = 7.05Class C Widgets: (2 * 3.45) = 6.9TOTALS: 15.2
  12. the only error I get with your code is: Notice: Undefined variable: error in /WebRoot/submitted.php on line 77 but it submits to the second page just fine (tested on my local server, NOT your page)
  13. The code Zane gave you about 5 posts ago should work nicely. I re-created your arrays so you can see it working, because (as Zane pointed out) we're not sure if they're arrays or json objects. try this and tell us if it's what you wanted: (I'm assuming you want ALL the players to be in the team ?) <?php $equipo = array( 'id_equipo' => '7', 'nom_equipo' => 'Vodka Juniors', 'locvis' => 'L' ); $jugadores = array( 0 => array( 'id_jugador' => '12', 'jugador_nom' => 'Omar', 'jugador_pat' => 'Ortiz', 'jugador_mat' => 'Flores', 'jug_repre' => 'N', 'jug_playera' => '16', 'fechareg' =>''), 1 => array( 'id_jugador' => '1', 'jugador_nom' => 'Francisco', 'jugador_pat' => 'Rojas', 'jugador_mat' => 'Ortega', 'jug_repre' => 'N', 'jug_playera' => '17', 'fechareg' =>'') ); $equipo['Jugadores'] = $jugadores; echo '<pre>'; print_r($equipo); ?>
  14. please use this code and post the results (so we can see what your arrays look like BEFORE you manipulate them) echo '<pre>'; print_r($jugador); print_r($equipo); echo '</pre>'; (sorry, edited post because I forgot to put the variables inside the print_f() print_r() functions)
  15. you're welcome. I wish you luck with the rest of the game. If you run into any problems, you know where to come
  16. Cool! that's good news, because we're already on page 3 and it's much harder to keep going back and check things. I'm glad it's working
  17. no, that shouldn't have made a difference...
  18. you really need to do what I said in my previous post, just after the $user query, please. I need to know it the info is being pulled out and lost somewhere else, or not being pulled out at all
  19. you need to print out more stuff to find the problem. put the <pre> print_r(...) stuff after each of those database queries, and comment out any redirects that page might have, so you can see the data as soon as it's pulled from the database. so: $stats_get = mysqli_query($myConnection,"SELECT * FROM `stats` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection)); $stats = mysqli_fetch_assoc($stats_get); echo '<pre>'; print_r($stats); echo '</pre>'; (and do the same for all 4 queries)
  20. hang on there... if you're referencing the user's info with his ID, what's the point of having the username repeated in all the databases (this makes it much harder is the username has to be changed for some reason)... Are you absalutely sure your script is accessing THAT database that you see in phpmyadmin, or do you have another copy somewhere? (because you're telling me a field called commname exists in the database, but select * isn't pulling it out. You must be giving me incorrect information somewhere.
  21. and are you sure you should be grabbing the data based on the table's ID (as apposed to a field called UID (or some other name) that you should have in there, since id is just the primary key?)
  22. see what's happening? 'commname' doesn't exist in there (are you sure theres a table field with that name in the database?) and the array $structure doesn't even exist for some reason. Are you sure you have a table called structure and that it has valid information for that specific user id you're using to pull stuff from the database?
  23. add this somewhere just to see what's in those two arrays, so you can see all the values and index names: echo '<pre>'; print_r($user); print_r($structure); echo '</pre>';
  24. ah, that's good news dude. You're quite welcome.
×
×
  • 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.