Jump to content

dlebowski

Members
  • Posts

    262
  • Joined

  • Last visited

Everything posted by dlebowski

  1. Thanks for the clarification. When i run phpinfo(), it tells me that my php.ini file is in /usr/lib. I am assuming this is where the file was put when php was installed on my server. If this is where phpinfo() shows my file, is it safe to assume this is the one it's reading? If so, I will remove the others.
  2. I was wondering how many php.ini files should I have on my server (dedicated) and where should I put them. When I run php info it tells me there is one in /usr/lib. If I look on my server, i have about 12 more in other directories. Any help would be appreciated. Thanks. Ryan
  3. I was wondering just how secure some of these programs that protect your source code actually are? For exampe, Source Guardian is a program that is suppose to protect your code, but how reliable is something like this? Anyone have experience with this type of thing?
  4. I need some advice on a question I have. Currently, I have a PHP application that my customers can run via the internet. As I add customers, I need to know what is the best way to handle multiple customers using different instances of the application. For example, right now my site is www.mysite.com/dlebowski. I have my own mysql database associated with it as well. I was thinking that any new customer that I add would be setup with www.mysite.com/newcustomer1 where my application resides in a seperate directory "newcustomer1" and a new mysql database is created. If I added another customer they would reside on www.mysite.com/newcustomer2 and also have their own mysql database. Is this the best way to hand this? All my clients will need their data in seperate mysql databases and I'm not sure of a better way to handle this. ANY help would be appreicated. Let me know if you have any other questions regarding my setup. -Ryan
  5. I was wondering if there was a way to pass a hidden value to a parent page from a popup? For example, below this works great if I am using _POST to retrieve the variable data. I want to use _GET though. Is there anyway to pass a variable from a popup window to the parent window so it can be retrieved using _Get. Thanks in advance for any assistance. <script language="javascript"> <!-- window.opener.location = '<? echo "{$_SERVER['']}cashiering.php?page=$page&LotAuctionDate=$PaymentAuctionDate&pay_Buyer=$buyerid" ?>'; //--> </script>
  6. Do I put it after: session_start(); ? XAMPP version of php is 5.2.5 and server is 5.2.4. When i do a print $_SESSION['username']; i get nothing back on my server. IN XAMPP it works great.
  7. I am having trouble getting sessions to work on my server. I built my site using XAMPP and it works perfect there, but as soon as I move it all to my server, sesssions don't work any longer. Here is a portion of my php.ini file. Can anyone see anything that I may need to change? session.save_handler = files ; handler used to store/retrieve data session.save_path = /tmp ; argument passed to save_handler ; in the case of files, this is the ; path where data files are stored session.use_cookies = 1 ; whether to use cookies session.name = PHPSESSID ; name of the session ; is used as cookie name session.auto_start = 0 ; initialize session on request startup session.cookie_lifetime = 0 ; lifetime in seconds of cookie ; or if 0, until browser is restarted session.cookie_path = / ; the path the cookie is valid for session.cookie_domain = ; the domain the cookie is valid for session.serialize_handler = php ; handler used to serialize data ; php is the standard serializer of PHP session.gc_probability = 1 ; percentual probability that the ; 'garbage collection' process is started ; on every session initialization session.gc_maxlifetime = 1440 ; after this number of seconds, stored ; data will be seen as 'garbage' and ; cleaned up by the gc process session.referer_check = ; check HTTP Referer to invalidate ; externally stored URLs containing ids session.entropy_length = 0 ; how many bytes to read from the file session.entropy_file = ; specified here to create the session id ; session.entropy_length = 16 ; session.entropy_file = /dev/urandom session.cache_limiter = nocache ; set to {nocache,private,public} to ; determine HTTP caching aspects session.cache_expire = 180 ; document expires after n minutes session.use_trans_sid = 1 ; use transient sid support if enabled ; by compiling with --enable-trans-sid
  8. Why won't this work? I get this error "Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';'" echo "<option value="$nt['YEAR(Date)']">$nt['YEAR(Date)']</option>";
  9. Thank you for the quick response. $date = $nt['date']; won't work because I am using YEAR(date) in my query. That is where I am running into the problem. Any other suggestions?
  10. I'm sure this is an easy one. Just can't seem to figure it out. I have this code that basically populates a dropdown box from the database. <?php include("dbinfo.inc.php"); mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query = "SELECT YEAR(Date) FROM auctions GROUP BY YEAR(Date)"; $result = mysql_query ($query); echo "<select name=Date>"; // printing the list box select command while($nt=mysql_fetch_array($result)) { //Array or records stored in $nt echo "<option value=$nt[YEAR(Date)]>$nt[YEAR(Date)]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> This portion of the code does not work. It won't populate the values. I know it's syntax. Any help would be appreciated! Thanks. echo "<option value=$nt[YEAR(Date)]>$nt[YEAR(Date)]</option>";
  11. What i have is a query that returns a list of values in a database for me to select using a drop down box. In this case, I have dates in a database and I want each one of those dates to be provided to me as an option in a drop down. This works perfectly. What I am having trouble with is when I make a selection from the drop down and click "submit" I want the value that was submitted to be the default value in the drop down. Currently, the first date shows up by default because I have "ORDER BY Date" in my query. I want this to actually have the value that I submitted when clicking on "submit" to be the default value in the drop down instead of the earliest date. So if I have $Date=$_POST['Date']; with the Date value being "2008-05-09", I want that date to be the default value in the box. Let me know if this isn't clear and I will elaborate. Thank you in advance. <?php include("dbinfo.inc.php"); mysql_connect("localhost",$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query = "SELECT * FROM database ORDER BY Date"; $result = mysql_query ($query); echo "<select name=Date>"; while($nt=mysql_fetch_array($result)){//Array or records stored in $nt echo "<option value=$nt[Date]>$nt[Date]</option>"; } echo "</select>"; ?>
  12. I figured it out. Below is what I did. <script language="javascript"> <!-- setTimeout("self.close();",2000) window.opener.location = '<? echo "{$_SERVER['']}newpage.php" ?>'; //--> </script>
  13. I have a page that generates a popup using ONSUBMIT="openTarget In this new pop up page is some results with the ability to update them. Once I update them, I want the popup to automatically close and the parent page to refresh to a certain URL. I am currently using the below code and it works great with one exception. setTimeout("self.close();",2000) opener.location.reload(); Is there any way to make the parent window refresh to a different URL? For example if the parent page is originally "test.php?variable=1", after the pop up closes I want the page to be refreshed to "test.php". Thanks in advance. Ryan
  14. I can't tell you how much I appreciate all the help. bcmul works perfectly.
  15. I think I may have figured it out. It doesn't like me to use number_format for both my $CashPremiumDue variable and my $amountdue value. I was using number_format to generate the $CashPremiumDue value. change from: $CashPremiumDue=number_format(($GrandTotalNoPremium * $BuyerCashPrem), 2, '.', ','); to: $CashPremiumDue=round (($GrandTotalNoPremium * $BuyerCashPrem), 2); This appears to have worked although I am off by .01 in a lot of the cases. I will have to maybe play with the rounding to take care of this. Why would it not let me use number_format for both $amountdue and $CashPremiumDue?
  16. $GrandTotalNoPremium = ($ItemTotalPrice + $absenteebid + $TaxTotal) + $CashPremiumDue; $AllPaymentTotal = (($CashTotalPaid + $CheckTotalPaid + $CreditTotalPaid) - $CashPremiumPaid); $amountdue = number_format(($GrandTotalNoPremium - $AllPaymentTotal), 2, '.', ','); } ?> </td> <? print $ItemTotalPrice; ?><br><? print $TaxTotal; ?> <br><? print $CashPremiumDue; ?> <br><? print $CashTotalPaid; ?> <br><? print $absenteebid; ?> <br><? print $CashTotalPaid; ?> <br><? print $CheckTotalPaid; ?> <br><? print $CreditTotalPaid; ?> <br><? print $CashPremiumPaid; ?> <br><? print $amountdue; ?> Here is what I get for the values: 90000 900 4,545.00 0.00 0 0.00 0.00 0.00 0 90,904.00 I did create a file called test.php and ran the code in it and it does calculate correctly. But if I run it within the original script, I get the results above. I don't understand how this is happening.
  17. Thanks for the explanation. This will always be a decimal though because is it a monetary value. How would I handle that?
  18. $ItemTotalPrice=90000 $TaxTotal=900 $CashPremiumDue=4545.00 $CashTotalPaid=0 $GrandTotalNoPremium = ($ItemTotalPrice + $TaxTotal) + $CashPremiumDue; $AllPaymentTotal = $CashTotalPaid; $amountdue = number_format(($GrandTotalNoPremium - $AllPaymentTotal), 2, '.', ','); print "$cym"; print $amountdue; For some reason, $amountdue=90904 instead of 95445. I do not have this problem when $ItemTotalPrice is a smaller value like $1000. This works fine. Has anyone else seen anything like this before?
  19. Honestly. I think you just figured it out for me. I never have been outstanding at math and I kept wanting to use .01 instead of 1.01. I think that may have just taken care of my entire problem. So far I have used that and it appears to work on every number I have used it on.
  20. $75 Total Items Purchased 1% Buyers Premium for Cash 2% Buyers Premium for CC $38 for Cash is actually = $37.63 + .37 (1% Buyers Cash Premium) $75 Total Items Purchased -$37.63 Cash ------------ $37.37 Amount Left To Pay on CC Before 3% CC Premium $37.37 + $1.12 (3% Buyers Credit Card Prem) = $38.49 When all is said and done, he paid $38.49 on his CC and $38 in cash. Thanks for having a look again.
  21. That is essentially what this scrip does. I have it integrated into a couple of php sites. It generates the text box to add into your site. Let me know if you have other questions about it. I'd be happy to help.
  22. I have isolated the problem to this. When someone makes a payment via cash, credit card, or check the values are stored in the database individually and then retried in the values $cash, $charge, and $checking. The problem is that I need to figure out how much of the payment was the "premium" and how much came off of the base total. So, $100 at 1% would be an additional $1. So the table would have $101 entry in it. Well, when I retrieve that payment in the queries below, I need to know how much of that is the premium and how much is from the base total. This will allow me to figure out how much the credit card premium or the check premium will be with the remaining base total. I think the equation to find that would be Premium = PaymentTotal - (PremiumPercentage x PaymentTotal). I'm just not sure how to implement that. Thanks for any help you can provide.
  23. Let me start off by apologizing. I am fried right now from trying to work on this and wasn't thinking straight when I started this post. I didn't mean to make it sound like I was just wanting you to come up with the solution. I just was making sure what I was trying to do was even possible. I actually posted the code in another post and didn't get any responses. So either it was a totally stupid question or my request was hopless. Below are the two pieces of code. Let me know if I can provide anything else. I have been working on this for three days and just cannot get it. Thans for all your help. <? <? include("dbinfo.inc.php"); mysql_connect("localhost",$username,$password); @mysql_select_db($database) or die( "Unable to select database"); // POST value of id that sent from form submission $PaymentAuctionDate=$_POST['pay_LotAuctionDate']; $query="SELECT * FROM auctions WHERE AuctionDate='$PaymentAuctionDate'"; $result=mysql_query($query); $percent= "%"; while($row = mysql_fetch_array( $result )) { $BuyerCashPrem = ($row['BuyerCashPrem']/100); $BuyerCheckPrem = ($row['BuyerCheckPrem']/100); $BuyerCreditPrem = ($row['BuyerCreditPrem']/100); $CheckPaid = ($checking * $BuyerCheckPrem); $CreditPaid = ($charge * $BuyerCreditPrem); $CashPaid = ($cash * $BuyerCashPrem); $CashPaid = substr($CashPaid, 0, ((strpos($CashPaid, '.')+1)+2)); ?> <td style='color: black; text-align: left; width: 100px; font-size: 12px; border-collapse: collapse; border-spacing: 0px; order-spacing: 0px; padding: 0pt;'>PAYMENT PREM:</td> <TD width="1"></td> <? $grandtotal = (($sum + $absenteebid + $taxtotal+ $BuyerCashPrem)-(($cash - $CashPaid)+($check - $CheckPaid)+($credit - $CreditPaid))); $cashprem=($grandtotal * $BuyerCashPrem); $cashprem = substr($cashprem, 0, ((strpos($cashprem, '.')+1)+2)); ?> <TD class=grid><? echo $row['BuyerCashPrem'];echo $percent;?> = <? echo "$cym$cashprem";?></td> <TD width="1"></td> <? $grandtotal = number_format((($sum + $absenteebid + $taxtotal)-(($cash - $CashPaid)+($checking - $CheckPaid)+($charge - $CreditPaid))),2,".",","); $checkprem=number_format(($grandtotal * $BuyerCheckPrem),2,".",","); ?> <TD class=grid><? echo $row['BuyerCheckPrem'];echo $percent;?> = <? echo "$cym$checkprem";?></td> <TD width="1"></td> <? $grandtotal = number_format((($sum + $absenteebid + $taxtotal)-(($cash - $CashPaid)+($checking - $CheckPaid)+($charge - $CreditPaid))),2,".",","); $creditprem=number_format(($grandtotal * $BuyerCreditPrem),2,".",","); ?> <TD class=grid><? echo $row['BuyerCreditPrem'];echo $percent;?> = <? echo "$cym$creditprem";?></td> <? if ($Exempt=="YES") { $grandtotal = (($sum + $absenteebid)); $AllPaymentTotal = (($cash + $checking + $charge)); $amountdue = ($grandtotal - $AllPaymentTotal); print "$cym"; print $amountdue; } else { $grandtotal = ($sum + $absenteebid + $taxtotal + $cashprem); $AllPaymentTotal = (($cash + $checking + $charge)-($CashPaid+$CheckPaid+$CreditPaid)); $amountdue = ($grandtotal - $AllPaymentTotal); $amountdue = $amountdue; print "$cym"; print $amountdue; } ?> </td> <TD width="1"></td> <td class=grid> <? if ($Exempt=="YES") { $grandtotal = (($sum + $absenteebid + $checkprem)); $AllPaymentTotal = (($cash + $checking + $charge)); $amountdue = ($grandtotal - $AllPaymentTotal); print "$cym"; print $amountdue; } else { $grandtotal = ($sum + $absenteebid + $taxtotal + $checkprem); $AllPaymentTotal = (($cash + $checking + $charge)-($CashPaid+$CheckPaid+$CreditPaid)); $amountdue = ($grandtotal - $AllPaymentTotal); $amountdue = number_format($amountdue,2,".",","); print "$cym"; print $amountdue; } ?> </td> <TD width="1"></td> <td class=grid> <? if ($Exempt=="YES") { $grandtotal = ($sum + $absenteebid + $creditprem); $AllPaymentTotal = ($cash + $checking + $charge); $amountdue = ($grandtotal - $AllPaymentTotal); print "$cym"; print $amountdue; } else { $grandtotal = ($sum + $absenteebid + $taxtotal + $creditprem); $AllPaymentTotal = (($cash + $checking + $charge)-($CashPaid+$CheckPaid+$CreditPaid)); $amountdue = ($grandtotal - $AllPaymentTotal); $amountdue = number_format($amountdue,2,".",","); print "$cym"; print $amountdue; } ?>
×
×
  • 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.