Jump to content

phpretard

Members
  • Posts

    821
  • Joined

  • Last visited

    Never

Everything posted by phpretard

  1. I serialized it and inserted it that way. Well it worked and all of the data in in the database and now I can't get it back out in the form of an array? ROW1 now = a:1:{s:0:"";a:10:{s:8:"customer";s:28:"ENS Metals and Jewelry, Inc.";s:8:"category";s:18:"Marketing Material";s:7:"product";s:17:"Tri-Fold Brochure";s:7:"Cnumber";s:6:"156882";s:3:"Qty";s:0:"";s:4:"Item";s:18:"Marketing Material";s:11:"Description";s:30:"Tri-Fold Brochure | Full Color";s:4:"Cost";s:0:"";s:4:"Date";s:10:"05-08-2008";s:4:"Paid";s:0:"";}} How can I get it back out in the form of an array again? $result = mysql_query("SELECT * FROM table"); while($row = mysql_fetch_array($result)) { $ROW1=$row['ROW1']; echo "ARRAY HERE"; }
  2. So to insert I guess wouold be: mysql_query("INSERT INTO table (id, invoice) VALUES ('', '$_SESSION' )"); ??
  3. Could I insert this into as database table?
  4. How can I Give this array a name? $Cnumber=$_GET['cn']; $invoice= $_POST['file']; foreach($_POST as $key => $val){ $_SESSION[$invoice][$key] = $val; } //CLOSE FOR EACH This Makes and Array Like This: $_SESSION:Array ( [] => Array //CAN I REFERENCE THIS ARRAY BY NAME AND IF SO HOW DO I NAME IT? ( [customer] => ENS Metals and Jewelry, Inc. [category] => Marketing Material [product] => Tri-Fold Brochure [Cnumber] => 156882 [Qty] => [item] => Marketing Material [Description] => Tri-Fold Brochure | Full Color [Cost] => [Date] => 05-08-2008 [Paid] => ) ) OR...Does It Already Have a name and I am missing it?
  5. There really isn't much more code than what you see. Page 1. <a href=\"page2.php?c=ENS Metals and Jewelry\">GO TO PAGE 2</a> -------------------------------------------------------------------------------------- [code] Page 2. <? $c=$_GET['c']; echo $c; // ON PAGE 2 IT ECHOS: ENS Metals and Jewelry echo"<a href=\"page3.php?c=$c\">GO TO PAGE 3</a>"; ?> NOTE: On page 2 the address bar reads: page2.php?c=ENS%20Metals%20and%20Jewelry -------------------------------------------------------------------------------------- Page 3. <? $C=$_GET['c']; echo $c; // ON PAGE 3 IT ECHOS: ENS ?> [/code]
  6. <?php echo " <html> <head> <title> HUH?</title> <body> I Don't Really Understanf The Question. </body> </html>"; ?>
  7. I am trying to pass this twice to a $_GET and it will only show the first word on the second pass. When I pass it the first time is shows in the browser like so ?page=secure/main&Spage=admin/invoices&s=category&c=ENS%20Metals%20and%20Jewelry,%20Inc. and it echos the full name... When I send it again as a variable it only echos ENS I think the %20 (spaces) are screwing it up Does anyone know why? $c=ENS Metals and Jewelry ?page=secure/main&Spage=admin/invoices&s=category&c=$c&p=products
  8. Simple as pie. Thank a million!
  9. I am trying to come up wth a grand total using multipple totals. Here is how I am getting the total: $result = mysql_query("SELECT * FROM invoices WHERE Cnumber='$Cnumber'"); while($row = mysql_fetch_array($result)) { $Cnumber=$row['Cnumber']; $qty=$row['qty']; $item=$row['item']; $description=$row['description']; $cost=$row['cost']; $date=$row['date']; $paid=$row['paid']; $total=(($qty)*($cost)).".00"; // THIS IS THE TOTAL $grandtotal=THE PROBLEM; } echo" <tr> <td id='qty'>$qty</td> <td id='item'>$item</td> <td id='description'>$description</td> <td id='cost'>$$cost</td> <td id='total'>$$total</td> </tr> "; } What the code above does is gives me a row in a table showing the individual totals. I have tried many different methods and can't seem to get one to add each row's total to come up with a grand total. I want to say that a foreach loop might solve the problem but I can't seem to code it right. Would love some help on this one. Thank errbody!
  10. I just want to send an email via PHP that has a link instead of the href content. I've searched the net and found complex information I don't need. I am sure there is a simple way to accomplish this with the right knowledge (that I don't have). Through searching I know it needs to have some type of headers but I don't know which. $to = $Cemail; $email="registration@website.com"; $subject = "Registration"; $body.= "Message from: ".$company; $body.= "\n"; $body.= "\n"; $body.= "You Have Recently Registered With $company"; $body.= "\n"; $body.= "\n"; $body.= "Your Login Information is:"; $body.= "\n"; $body.= "\n"; $body.= "Username: ".$user ; $body.= "\n"; $body.= "Password: ".$pass; $body.= "\n"; $body.= "\n"; $body.="<a href='http://www.website.com?page=secure/main_login&customer=first&myusername=$user&mypassword=$pass>Click Here to login</a>"; mail( $to, $subject, $body, "From: $email"); I would like the link to show up in the email like so: Click Here to login and when you click it actually take you where you need to be. All I can get it to do is deliver this: <a href='http://www.website.com?page=secure/main_login&customer=first&myusername=$user&mypassword=$pass>Click Here to login</a> Thanks for helping.
  11. I would like to consistanly generate a 6 digit random number. Seems easy enough, but the code below sometimes generates less than or 6 digits? rand(000000, 999999); Anybody know why?
  12. I am trying to validate a street address. I have managed to accept only letters and number but my code won't allow for a space. if (!eregi ("^[[:alnum:]+]+$", $COStreet)){ $valid="NOPE"; } Any helpers?
  13. I am trying to validate a street address. I have managed to accept only letters and number but my code won't allow for a space. if (!eregi ("^[[:alnum:]+]+$", $COStreet)){ $valid="NOPE"; } Any helpers?
  14. This is copied straight from the page. It doesn't work $fp = fopen("$page.".php", 'w'); fclose($fp); $filename = "$page".php"; error Parse error: syntax error, unexpected '"' on line 11
  15. This names my page "$page.php"; instead of "some_page"; $page="some_page"; $fp = fopen("$page.php", 'w'); Does anyone know why?
  16. I need to copy and paste content from MSWord into a text field(IN DB) and output all of the line breaks, font colors, etc... Is there any way to do this without using Rich Text?
  17. Would this take the place of all the POST statements? That's what it looks like...
  18. Some pages for example...432.php might be written as such: if (You aint got no business here){ echo "Nonya Business"; } else { echo "Here's Ya Business"; }
  19. How can I echo all posted variable in one php statement? $_POST['mc_gross']; $_POST['address_status']; $_POST['payer_id']; $_POST['tax']; $_POST['address_street']; $_POST['payment_date']; $_POST['payment_status']; $_POST['charset']; $_POST['address_zip']; $_POST['first_name']; $_POST['address_country_code']; $_POST['address_name']; $_POST['notify_version']; $_POST['custom'];""> $_POST['payer_status']; $_POST['business']; $_POST['address_country']; $_POST['address_city']; $_POST['quantity']; $_POST['payer_email']; $_POST['verify_sign']; $_POST['txn_id']; $_POST['payment_type']; $_POST['payer_business_name']; $_POST['last_name']; $_POST['address_state']; $_POST['receiver_email']; $_POST['receiver_id']; $_POST['pending_reason']; $_POST['txn_type']; $_POST['item_name']; $_POST['mc_currency']; $_POST['item_number']; $_POST['residence_country']; $_POST['payment_gross']; $_POST['shipping']; These are all of the things that paypal gives back after payment. Thank you!
  20. // THIS IS HOW THE ARRAY SETS UP Array ( [P1120081.jpg] => Array ( [picture] => ALBUMS/Denis/P1120081.jpg [file] => P1120081.jpg [QU46] => 0 [QU57] => 1 [QU810] => 0 [QU1114] => 2 [QU1216] => 0 [QU1620] => 0 [QU2024] => 4 [QU2030] => 0 [order_photo] => Update This Order ) [P1120082.jpg] => Array ( [picture] => ALBUMS/Denis/P1120082.jpg [file] => P1120082.jpg [QU46] => 10 [QU57] => 0 [QU810] => 0 [QU1114] => 13 [QU1216] => 0 [QU1620] => 0 [QU2024] => 15 [QU2030] => 0 [order_photo] => Order This Photo ) ) //THIS ADDS THE TOTALS AND PUTS IT AN VAR CALLED $total foreach ($_SESSION as $file => $val){ $P46=($_SESSION[$file]['QU46'] * 7); $P57=($_SESSION[$file]['QU57'] * 10); $P810=($_SESSION[$file]['QU810'] * 20); $P1114=($_SESSION[$file]['QU1114'] * 40); $P1216=($_SESSION[$file]['QU1216'] * 50); $P1620=($_SESSION[$file]['QU1620'] * 60); $P2024=($_SESSION[$file]['QU2024'] * 70); $P2030=($_SESSION[$file]['QU2030'] * 80); $total=($P46+$P57+$P810+$P1114+$P1216+$P1620+$P2024+$P2030); } echo GRAND TOTAL???? Somehow I need a grand total from this mess. Any thought on this?
  21. Yes...I read it, and search google before I post (as descrided in site conditions). The code I keep running into puts it all into an array... I don' think I need an array to count words or do I?
×
×
  • 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.