graham23s
Members-
Posts
890 -
Joined
-
Last visited
Everything posted by graham23s
-
Hi Guys, I'm having trouble with a bit of syntax: if ((!empty($_POST['twitUser']) && !empty($_POST['twitPass'])) Is the proper way to put () around both !empty fields or () around the whole code? thanks guys Graham
-
Hi Guys, I'm trying to think of a way to give users credit for referring other users, in each users account there is a link: http://www.site.com/sign-up.php?r=8 <-- is is the users ID. when new users goto: http://www.site.com/sign-up.php?r=8 to signup what would be the best way to give user 8 the credit for signing up another user? thanks for any help guys Graham
-
Hi Mate, Still never worked, the thing is if i do this: <?php ob_start(); session_start(); include("inc/inc-dbconnection.php"); include("inc/inc-online.php"); include("inc/inc-functions.php"); include("inc/inc-header.php"); ?> <div class="fcp-main-content-area"> <div class="fcp-breadcrumb"> <ul> <li><a href="index.php">Home</a></li> >> <li><a href="javascript:history.go(-1)">Previous Page</a></li> >> <li>Login in to your account.</li> </ul> </div> <?php if (isset($_POST['submitLogin'])) { // POST vars $user = $_POST['user']; $pass = $_POST['pass']; // Errors array() $errors = array(); // Potential errors // Empty fields if (empty($user) || empty($pass)) { $errors[] = "You never filled in all the fields above."; } // Does user exist? $qU = "SELECT * FROM `fso_users` WHERE `user_email`='$user' AND `user_password`='$pass' LIMIT 1"; $rU = mysql_query($qU); if (mysql_num_rows($rU) < 1) { $errors[] = "We don't recognise those login details, have you typed them correctly?"; } // Count the errors and display if (count($errors > 0)) { print "<div id=\"error\">"; foreach($errors as $error) { print "<b>></b> $error<br />"; } print "</div>"; } // Update the login timer and redirect $timer = mysql_query("UPDATE `fso_users` SET `user_last_login`=NOW() WHERE `user_email`='$user' AND `user_password`='$pass'"); // Array() $aU = mysql_fetch_array($rU); // $_SESSION['']; $_SESSION['loggedIn'] = 1; $_SESSION['user_id'] = $aU['user_id']; // Lastly redirect to the account page header("Location: account.php"); ob_clean(); } ?> <div id="div-regForm"> <div class="form-title">Log In</div> <div class="form-sub-title">Login & see your points score!</div> <form id="regForm" action="login.php" method="post"> <table> <tbody> <tr> <td><label for="fname">Email:</label></td> <td><div class="input-container"><input name="user" id="user" type="text" /></div></td> </tr> <tr> <td><label for="lname">Password:</label></td> <td><div class="input-container"><input name="pass" id="pass" type="text" /></div></td> </tr> <tr> <td> </td> <td><input type="submit" class="greenButton" name="submitLogin" value="Login" /> </td> </tr> </tbody> </table> </form> </div> <?php include("inc/inc-footer.php"); ?> The way it is above i can type anything in or even just hit the submit it logs in normally and even displays the proper data on the account page: <?php include("inc/inc-sessions-user.php"); include("inc/inc-dbconnection.php"); include("inc/inc-online.php"); include("inc/inc-functions.php"); include("inc/inc-header.php"); include("inc/inc-arrays.php"); ?> <div class="fcp-main-content-area"> <div class="fcp-breadcrumb"> <ul> <li><a href="index.php">Home</a></li> >> <li><a href="javascript:history.go(-1)">Previous Page</a></li> >> <li>My account - [<a href="logout.php">Logout</a>]</li> </ul> </div> <?php print $_SESSION['loggedIn'] . " + " . $_SESSION['user_id']; ?> <?php include("inc/inc-footer.php"); ?> I'm thinking it must be an error with my if/else code somewhere. cheers mate Graham
-
Hi Mate, ah ok, i'll use that as a rule of thumb for all forms i moved the PHP code to the top but this else code doesn't seem to be executed: } else { // Update the login timer and redirect $timer = mysql_query("UPDATE `fso_users` SET `user_last_login`=NOW() WHERE `user_name`='$user' AND `user_password`='$pass'"); the credentials are definately correct i can't see what's wrong. cheers mate Graham
-
Hi Guys, Something seems to be up with my login script, once the credentials are put in it doesn't seem to goto the protected page which is: account.php code: <?php ob_start(); session_start(); include("inc/inc-dbconnection.php"); include("inc/inc-online.php"); include("inc/inc-functions.php"); include("inc/inc-header.php"); ?> <div class="fcp-main-content-area"> <div class="fcp-breadcrumb"> <ul> <li><a href="index.php">Home</a></li> >> <li><a href="javascript:history.go(-1)">Previous Page</a></li> >> <li>Login in to your account.</li> </ul> </div> <div id="div-regForm"> <div class="form-title">Log In</div> <div class="form-sub-title">Login & see your points score!</div> <form id="regForm" action="login.php" method="post"> <table> <tbody> <tr> <td><label for="fname">Email:</label></td> <td><div class="input-container"><input name="user" id="user" type="text" /></div></td> </tr> <tr> <td><label for="lname">Password:</label></td> <td><div class="input-container"><input name="pass" id="pass" type="text" /></div></td> </tr> <tr> <td> </td> <td><input type="submit" class="greenButton" name="submitLogin" value="Sign Up" /> </td> </tr> </tbody> </table> </form> <?php if (isset($_POST['submitLogin'])) { $user = $_POST['user']; $pass = $_POST['pass']; $errors = array(); // Potential errors // Empty fields if (empty($user) || empty($pass)) { $errors[] = "You never filled in all the fields above."; } // Does user exist? $qU = "SELECT * FROM `fso_users` WHERE `user_name`='$user' AND `user_password`='$pass' LIMIT 1"; $rU = mysql_query($qU); if (mysql_num_rows($rU) < 1) { $errors[] = "Those login details are in-correct."; } // Count the errors if (count($errors > 0)) { foreach($errors as $error) { print "<div id=\"error\">$error</div>\n"; } } else { // Update the login timer and redirect $timer = mysql_query("UPDATE `fso_users` SET `user_last_login`=NOW() WHERE `user_name`='$user' AND `user_password`='$pass'"); // Array() $aU = mysql_fetch_array($rU); // Credentials $_SESSION['logged_in'] = 1; $_SESSION['user_id'] = $aU['user_id']; // Lastly redirect to the account page header("Location: account.php"); ob_clean(); } } // End main isset ?> </div> <?php include("inc/inc-footer.php"); ?> I have something similar on another site and that seems to work i can't figure it out any help would be appreciated cheers Graham
-
Hi Mchl, ah i never saw that, thanks mate i use xmlWriter a fair bit in vbnet, the output using fwrite has been surprisibly good, the output now is: <gallery title="Miracle Lift - Before And After Photos" thumbDir="./images/thumbs/" imageDir="./images/" random="true"> <category name="Before Miracle Lift"> <image> <date>2010-01-02 14:06:32</date> <title>TEXT</title> <desc>Esther, before her procedure.</desc> <thumb>thumb-esther_before_(front).jpg</thumb> <img>esther_before_(front).jpg</img> </image> </category> <category name="After Miracle Lift"> <image> <date>2010-01-02 14:07:07</date> <title>TEXT</title> <desc>Susan 4 days after.</desc> <thumb>thumb-sus_4_days_after_(front).jpg</thumb> <img>sus_4_days_after_(front).jpg</img> </image> </category> </gallery> Using the ammended code: <?php // Include the database connection include("admin/inc/db-connection.php"); $q = "SELECT * FROM `mftl_categories`"; $r = mysql_query($q); $file = "gallery_test.xml"; $fh = fopen($file, 'w'); $stringData = "<gallery title=\"Miracle Lift - Before And After Photos\" thumbDir=\"./images/thumbs/\" imageDir=\"./images/\" random=\"true\">\n"; //$stringData .= "<category name=\"$catName\">\n"; //fwrite($fh, $stringData); // Loop while ($a = mysql_fetch_array($r)) { $catName = $a['category_name']; // Select the images... $qI = "SELECT * FROM `mftl_images` WHERE `image_category`='$catName'"; $rI = mysql_query($qI); $aI = mysql_fetch_array($rI); // Local vars $imgDate = $aI['date']; $imgCate = $aI['image_category']; $imgFull = $aI['image_fullsize']; $imgThum = $aI['image_thumbnail']; $imgDesc = $aI['image_description']; if ($catName == $imgCate) { $stringData .= "<category name=\"$catName\">\n"; } $stringData .= " <image>\n"; $stringData .= " <date>$imgDate</date>\n"; $stringData .= " <title>TEXT</title>\n"; $stringData .= " <desc>$imgDesc</desc>\n"; $stringData .= " <thumb>$imgThum</thumb>\n"; $stringData .= " <img>$imgFull</img>\n"; $stringData .= " </image>\n"; $stringData .= "</category>\n"; } //fwrite($fh, $stringData); $stringData .= "</gallery>\n"; fwrite($fh, $stringData); fclose($fh); ?> The only thing is, there is actually 3 images being pulled from the database, but the way the code is now, it's only showing 1 of each category, i ideally need it structured like: <gallery title="Miracle Lift - Before And After Photos" thumbDir="./images/thumbs/" imageDir="./images/" random="true"> <category name="Before Miracle Lift"> <image> <date>2010-01-02 14:06:32</date> <title>TEXT</title> <desc>Esther, before her procedure.</desc> <thumb>thumb-esther_before_(front).jpg</thumb> <img>esther_before_(front).jpg</img> </image> <image> <date>2010-01-02 14:06:32</date> <title>TEXT</title> <desc>April, before her procedure.</desc> <thumb>thumb-april_before_(front).jpg</thumb> <img>april_before_(front).jpg</img> </image> </category> <category name="After Miracle Lift"> <image> <date>2010-01-02 14:07:07</date> <title>TEXT</title> <desc>Susan 4 days after.</desc> <thumb>thumb-sus_4_days_after_(front).jpg</thumb> <img>sus_4_days_after_(front).jpg</img> </image> </category> </gallery> is there any way i could accomplish this? i can't think how i would go about it lol thanks mate Graham
-
Hi Guys, i'm using fwrite to generate some xml for the image gallery, the structure of the gallery xml is: Gallery XML: <gallery title="Miracle Lift - Before And After Photos" thumbDir="./images/thumbs/" imageDir="./images/" random="true"> <category name="Introducing Seattle"> <image> <date>03.31.06</date> <title>View of Seattle</title> <desc>View of Seattle</desc> <thumb>seattle5.jpg</thumb> <img>seattle5.jpg</img> </image> <image> <date>03.31.06</date> <title>View of Seattle</title> <desc>View of Seattle</desc> <thumb>seattle7.jpg</thumb> <img>seattle7.jpg</img> </image> <image> <date>03.31.06</date> <title>My Town</title> <desc>On the way home</desc> <thumb>seattle10.jpg</thumb> <img>seattle10.jpg</img> </image> </category> <category name="Wedding"> <image> <date>02.44.04</date> <title>La Jolla Wedding</title> <desc>La Jolla Wedding</desc> <thumb>wedding1.jpg</thumb> <img>wedding1.jpg</img> </image> <image> <date>05.13.05</date> <title>Amazing Kiss</title> <desc>Amazing Kiss</desc> <thumb>wedding2.jpg</thumb> <img>wedding2.jpg</img> </image> <image> <date>11.21.05</date> <title>Wedding Time</title> <desc>Bride smiling</desc> <thumb>wedding3.jpg</thumb> <img>wedding3.jpg</img> </image> <image> <date>02.44.04</date> <title>10th anniversary</title> <desc>Picture taken on our 10th anniversary.</desc> <thumb>wedding4.jpg</thumb> <img>wedding4.jpg</img> </image> <image> <date>05.13.05</date> <title>SD wedding</title> <desc>Wedding at SD convention center</desc> <thumb>wedding5.jpg</thumb> <img>wedding5.jpg</img> </image> <image> <date>11.21.05</date> <title>Wedding Time</title> <desc>Wedding photo</desc> <thumb>wedding6.jpg</thumb> <img>wedding6.jpg</img> </image> <image> <date>06.14.06</date> <title>Togetherness</title> <desc>Wedding ceremony in Hawaii</desc> <thumb>wedding7.jpg</thumb> <img>wedding7.jpg</img> </image> </category> <category name="View of Asia"> <image> <date>04.01.06</date> <title>Bangkok</title> <desc>Bankok</desc> <thumb>bangkok1.jpg</thumb> <img>bangkok1.jpg</img> </image> <image> <date>04.01.06</date> <title>Bangkok</title> <desc>Bankok</desc> <thumb>bangkok2.jpg</thumb> <img>bangkok2.jpg</img> </image> <image> <date>04.01.06</date> <title>shopping in Singapore</title> <desc>shopping in Singapore Lau Pa Sat Festival Market Great place to drink & eat your lobsters..</desc> <thumb>sin.jpg</thumb> <img>sin.jpg</img> </image> <image> <date>04.01.06</date> <title>China Town Mexico</title> <desc>Chinese lion head over drums</desc> <thumb>china1.jpg</thumb> <img>china1.jpg</img> </image> <image> <date>04.05.06</date> <title>little bells</title> <desc>voice from the thailand's temple</desc> <thumb>bell.jpg</thumb> <img>bell.jpg</img> </image> <image> <date>04.08.06</date> <title>Green tea farm</title> <desc>Daehan green tea farm: Boseong, South Korea</desc> <thumb>korea1.jpg</thumb> <img>korea1.jpg</img> </image> </category> <category name="Trip to Montreal"> <image> <date>03.25.06</date> <title>Touring Old Montreal</title> <desc>**** Touring Old Montreal ****</desc> <thumb>tour3.jpg</thumb> <img>tour3.jpg</img> </image> <image> <date>03.25.06</date> <title>Touring Old Montreal</title> <desc>**** Touring Old Montreal ****</desc> <thumb>tour6.jpg</thumb> <img>tour6.jpg</img> </image> <image> <date>03.25.06</date> <title>Touring Old Montreal</title> <desc>**** Touring Old Montreal ****</desc> <thumb>tour10.jpg</thumb> <img>tour10.jpg</img> </image> <image> <date>03.25.06</date> <title>Touring Old Montreal</title> <desc>**** Touring Old Montreal ****</desc> <thumb>tour11.jpg</thumb> <img>tour11.jpg</img> </image> <image> <date>03.25.06</date> <title>Touring Old Montreal</title> <desc>**** Touring Old Montreal ****</desc> <thumb>tour13.jpg</thumb> <img>tour13.jpg</img> </image> </category> </gallery> My code for generating the XML file: <?php // Include the database connection include("admin/inc/db-connection.php"); $q = "SELECT * FROM `mftl_categories`"; $r = mysql_query($q); $file = "gallery_test.xml"; $fh = fopen($file, 'w'); $stringData = "<gallery title=\"Miracle Lift - Before And After Photos\" thumbDir=\"./images/thumbs/\" imageDir=\"./images/\" random=\"true\">\n"; $stringData .= "<category name=\"$catName\">\n"; fwrite($fh, $stringData); // Loop while ($a = mysql_fetch_array($r)) { $catName = $a['category_name']; // Select the images... $qI = "SELECT * FROM `mftl_images` WHERE `image_category`='$catName'"; $rI = mysql_query($qI); $aI = mysql_fetch_array($rI); // Local vars $imgDate = $aI['date']; $imgFull = $aI['image_fullsize']; $imgThum = $aI['image_thumbnail']; $imgDesc = $aI['image_description']; $stringData .= " <image>\n"; $stringData .= " <date>$imgDate</date>\n"; $stringData .= " <title>TEXT</title>\n"; $stringData .= " <desc>$imgDesc</desc>\n"; $stringData .= " <thumb>$imgThum</thumb>\n"; $stringData .= " <img>$imgFull</img>\n"; $stringData .= " </image>\n"; $stringData .= "</category>\n"; } fwrite($fh, $stringData); $stringData .= "</gallery>\n"; fwrite($fh, $stringData); fclose($fh); ?> this produces something very close but not quite right: <gallery title="Miracle Lift - Before And After Photos" thumbDir="./images/thumbs/" imageDir="./images/" random="true"> <gallery title="Miracle Lift - Before And After Photos" thumbDir="./images/thumbs/" imageDir="./images/" random="true"> <category name="Before Miracle Lift"> <image> <date>2010-01-02 14:06:32</date> <title>TEXT</title> <desc>Esther, before her procedure.</desc> <thumb>thumb-esther_before_(front).jpg</thumb> <img>esther_before_(front).jpg</img> </image> </category> <category name="After Miracle Lift"> <image> <date>2010-01-02 14:07:07</date> <title>TEXT</title> <desc>Susan 4 days after.</desc> <thumb>thumb-sus_4_days_after_(front).jpg</thumb> <img>sus_4_days_after_(front).jpg</img> </image> </category> <gallery title="Miracle Lift - Before And After Photos" thumbDir="./images/thumbs/" imageDir="./images/" random="true"> <category name="Before Miracle Lift"> <image> <date>2010-01-02 14:06:32</date> <title>TEXT</title> <desc>Esther, before her procedure.</desc> <thumb>thumb-esther_before_(front).jpg</thumb> <img>esther_before_(front).jpg</img> </image> </category> <category name="After Miracle Lift"> <image> <date>2010-01-02 14:07:07</date> <title>TEXT</title> <desc>Susan 4 days after.</desc> <thumb>thumb-sus_4_days_after_(front).jpg</thumb> <img>sus_4_days_after_(front).jpg</img> </image> </category> </gallery> i can't see why the title (top) tag is generated twice, the loop doesn't start untill well below,. thanks fior any help guys Graham
-
Hi Guys, I have a dynamic flash photogallery that displays the images/titles according to whats in the xml file, i'm going to be pulling information from the database to generate the xml file but i'm not sure how thats done? do i make a gallery.php file and force it to be read as an xml file with .htaccess? thanks guys Graham
-
lol that is a very good point hehe, i think i might just finish watching the bond movie and leave this till next year lol thanks guys Graham
-
Hi Guys, I was looking at it as more of a challenge to myself to see if i could do it lol, i usaualy get there in the end with programming tasks, but the more i read it looks like it might be a lot of wasted time in the end eh? thanks guys Graham
-
Hi Guys, From my initial search i know this isn't the easiest of things to do I am coding up a small game for my mates little boy, it's guess the numbers etc with each number on a seperate .jpg, the part i am doing just now is the AI (in it's basic form) of the computer player, they are white text on a black background, i was wondering how hard it would be to code in PHP to read that number? it's not a captcha or anything just basic number, plus double figure number would have 2 numbers on it, a bit more difficult. is there any tutorials or anything i could read up on, reading images? thanks for any help guys Graham
-
ahh thanks guys, all of them would do perfect Graham
-
Hi Guys, When coding in vb.net i can use: if (html.Contains("string i'm searching for") then... its a really fast way to see if the html string contains some text, i was wondering if there was anything similar for php? cheers for any info guys Graham
-
Hi Guys, Thanks a ton Graham
-
Hi Mate, Here it is: <?xml version="1.0" encoding="UTF-8" ?> - <CartGetResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2009-10-01"> - <OperationRequest> - <HTTPHeaders> <Header Name="UserAgent" Value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SU 3.23; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" /> </HTTPHeaders> <RequestId>0WQF79V8AA6Q5BDXZHQZ</RequestId> - <Arguments> <Argument Name="Service" Value="AWSECommerceService" /> <Argument Name="Operation" Value="CartGet" /> <Argument Name="Version" Value="2009-10-01" /> <Argument Name="Timestamp" Value="2009-12-20T13:47:59Z" /> <Argument Name="AssociateTag" Value="firschoishop-21" /> <Argument Name="Signature" Value="=" /> <Argument Name="HMAC" Value="" /> <Argument Name="CartId" Value="277-8907303-9128266" /> <Argument Name="AWSAccessKeyId" Value="AKIAI4FF5RJXRBLUF6FQ" /> </Arguments> <RequestProcessingTime>0.0379190444946289</RequestProcessingTime> </OperationRequest> - <Cart> - <Request> <IsValid>True</IsValid> - <CartGetRequest> <CartId>277-8907303-9128266</CartId> <HMAC>5ETnH+45f5IRoHePIEoyT2XcEiw=</HMAC> </CartGetRequest> </Request> <CartId>277-8907303-9128266</CartId> <HMAC>5ETnH+45f5IRoHePIEoyT2XcEiw=</HMAC> <URLEncodedHMAC>5ETnH%2B45f5IRoHePIEoyT2XcEiw%3D</URLEncodedHMAC> <PurchaseURL>https://www.amazon.co.uk/gp/cart/aws-merge.html?cart-id=277-8907303-9128266%26associate-id=firschoishop-21%26hmac=5ETnH%2B45f5IRoHePIEoyT2XcEiw=%26SubscriptionId=AKIAI4FF5RJXRBLUF6FQ%26MergeCart=False</PurchaseURL> - <SubTotal> <Amount>2156</Amount> <CurrencyCode>GBP</CurrencyCode> <FormattedPrice>£21.56</FormattedPrice> </SubTotal> - <CartItems> - <SubTotal> <Amount>2156</Amount> <CurrencyCode>GBP</CurrencyCode> <FormattedPrice>£21.56</FormattedPrice> </SubTotal> - <CartItem> <CartItemId>U3CJYU4J8670SU</CartItemId> <ASIN>B0027UY836</ASIN> <MerchantId>A3P5ROKL5A1OLE</MerchantId> <SellerId>A3P5ROKL5A1OLE</SellerId> <SellerNickname>Amazon.co.uk</SellerNickname> <Quantity>1</Quantity> <Title>The Haunting In Connecticut [DVD] [2009]</Title> <ProductGroup>DVD</ProductGroup> - <Price> <Amount>1258</Amount> <CurrencyCode>GBP</CurrencyCode> <FormattedPrice>£12.58</FormattedPrice> </Price> - <ItemTotal> <Amount>1258</Amount> <CurrencyCode>GBP</CurrencyCode> <FormattedPrice>£12.58</FormattedPrice> </ItemTotal> </CartItem> - <CartItem> <CartItemId>U1PTXH2CW08KEJ</CartItemId> <ASIN>B001PR1ZOC</ASIN> <MerchantId>A3P5ROKL5A1OLE</MerchantId> <SellerId>A3P5ROKL5A1OLE</SellerId> <SellerNickname>Amazon.co.uk</SellerNickname> <Quantity>1</Quantity> <Title>Fast & Furious [DVD] [2009]</Title> <ProductGroup>DVD</ProductGroup> - <Price> <Amount>898</Amount> <CurrencyCode>GBP</CurrencyCode> <FormattedPrice>£8.98</FormattedPrice> </Price> - <ItemTotal> <Amount>898</Amount> <CurrencyCode>GBP</CurrencyCode> <FormattedPrice>£8.98</FormattedPrice> </ItemTotal> </CartItem> </CartItems> </Cart> </CartGetResponse> I really just need to add up all the quantities. thanks mate Graham
-
try this: image/jpeg Graham
-
Hi Guys, I am trying to show the user how many items they have in their shopping cart, i get the quantities from an amazon aws xml file, i tried: <?php $response = simplexml_load_file($url); foreach($response->Cart as $item) { $cartQY = $item->CartItems->CartItem->Quantity; $array = array($cartQY); } print count($array); ?> $cartQY = $item->CartItems->CartItem->Quantity; this reads each node and returns the quantity of each item in the cart, the way i have it now the foreach overwrites the quantity instead of adding to it, i'm not sure how to incrememnt the value. any help would be appreciated thanks guys Graham
-
ah thanks Alex Graham
-
Hi Guys, I can't figure out why i am getting a parse error with this basic ten op code: $prodTH = ($prodIA == "Y") ? "<img src=\"" . amazon_display_thumbnail($prodID) "\">" : '<img src="imgProducts/img-th/'.$productThumb.'" alt="'.$prodNM.'" border="0" /></a>'; i can't see where the error lies! any help would be appreciated thanks guys Graham
-
Hi Guys, I am going to setup a cron job that deletes certain database tables after 24 hours have lapsed, i save the date in mysql as: 2009-12-09 23:43:03. i'm not to seure how to write it, so the cron job deletes X if 2009-12-09 23:43:03 > 24 hours. any help would be appreciated. thanks guys Graham
-
Brilliant! works perfectly, thanks a ton WT. Graham
-
Hi Guys, Been at this for ages now i can't figure out how to do this, i have a function: function: function billing_payment_string($cusID, $ip, $referrer) { $q = "SELECT * FROM `fhp_orders` WHERE `customer_id`='$cusID'"; $r = mysql_query($q) or die (mysql_error()); while ($a = mysql_fetch_array($r)) { //{ $pID = $a['product_id']; $pQT = $a['quantity']; //print "The product id is: ". $pID; . "And the quantity is: " . $pQT . "<br>"; //$test = array("$pID"=>"$pQT"); //print $pID; } //print_r($test); $parameters = array('ip'=>'92.xxx.xx.xxx', 'sid'=>'9fe512105552ebfe963a98684a8daaa0', 'lang'=>'us', 'shipping_method_id'=>'1', 'wm'=>'3000', 'tr'=>'8027', 'pr'=>'11', 'site_id'=>'8027', 'nocustom'=>'', 'host'=>'site.com', 'referrer'=>'http://www.site.com/checkout.php', 'query'=>'', 'free_ship_method_id'=>'0', 'usa_euros'=>'0', 'use_pounds'=>'0', 'tmpl'=>'157', 'currency'=>'USD', 'version'=>'2.50', '3456'='4' ); //print "<pre>"; //print_r($parameters); //print "</pre>"; // Serialize the string //$stringSerialized = serialize($parameters); // Return the string for use... return $parameters; } The query at the top of the function gets me product_id and quantity data of all the orders in the customers cart, i need to loop the data somehow inside the parameters array to look like: '2346'=>'2', '6742'=>'4', etc i tried putting the query inside the array but the script came up a blank page with no errors printed to screen, is there a better way to loop out the data to go inside the array? thanks guys Graham
-
If the id is blank like you are showing: delete.php?delete=delete&id= there is a problem retieving the data from the database, better show your whole code Graham
-
Hi Mate, That will always say "Topic Deleted" because it's next in line to execute to find out if it's really deleted do: <?php if ($sql) // Thgis checks if the delete was successful (true) else (false) { print "Topic Deleted"; } else { print "An error occured deleting the topic!"; } ?> When you hover your cursor over: <a href="delete.php?delete=delete&id=$id">Delete</a>*** do you see the ID in the bottom left window in explorer? Graham
-
Hi Buddy, You don't seem to be passing the id through to the delete file, if ($_GET['delete']){ this checks if you want to delete the file, but then we need the id to tell mysql to delete. if you put: $id = $_GET['id']; in the delete file to that should work Graham