About to get fired over this
Moderator: General Moderators
-
lostinthecode
- Forum Newbie
- Posts: 15
- Joined: Fri Oct 08, 2010 1:33 pm
- Location: Fort Smith, Arkansas
- Contact:
Re: About to get fired over this
It is included in another file, there are about 6 files that work together to make this shopping cart work
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: About to get fired over this
Try placing var_dumps() and exit() around the script to determine where the values aren't persisting, but really, that spaghetti soup is insanity.
So I guess I'll leave it at good luck.
P.S., I'm sure if you offered someone like $100 they would probably debug it for you.
P.S.S, any boss that puts pressure on you like that to debug a really nasty legacy script in just a few hours, I would laugh at him. Try to explain to him the cost of bringing in and training someone new, to only experience the same issues as you, will likely far outweigh the additional hours you'd require to complete the task.
So I guess I'll leave it at good luck.
P.S., I'm sure if you offered someone like $100 they would probably debug it for you.
P.S.S, any boss that puts pressure on you like that to debug a really nasty legacy script in just a few hours, I would laugh at him. Try to explain to him the cost of bringing in and training someone new, to only experience the same issues as you, will likely far outweigh the additional hours you'd require to complete the task.
Re: About to get fired over this
post them bro....with all of us here we should be able to pinpoint the error your having...post all of em if you have to ....make sure to edit out the database connection info
Code: Select all
$conn = mysql_connect("********","*****","**********") or die(mysql_error());
Re: About to get fired over this
E_ALL doesn't mean the errors will be displayed. You also need to turn display_errors on. As I said, check the error log.
Re: About to get fired over this
I'm a PHP noob, but you sure you have the right database name in your shopping cart program? HostGator has a two part naming system for databases such as in your case:
agencyequipment_shopping cart
or maybe something like
agencyequipment_SomeNameHere
surely not much of an answer, but just trying to help.
best of luck to you
agencyequipment_shopping cart
or maybe something like
agencyequipment_SomeNameHere
surely not much of an answer, but just trying to help.
best of luck to you
Re: About to get fired over this
No more updates... Does that mean the boss was serious and the job is over?
-
lostinthecode
- Forum Newbie
- Posts: 15
- Joined: Fri Oct 08, 2010 1:33 pm
- Location: Fort Smith, Arkansas
- Contact:
Re: About to get fired over this
Sorry I've been sick the past few days, actually the job is still here. My boss decided he wanted to move to godaddy for hosting so I had to help with that and magically the cart started working again. I do have one more problem though and it's really not that hard of a fix, but I can't figure it out.
That is just a snippet of the previous code I posted, I was wondering if there is a way to make the 'submit' button send an email instead of going to the authorization page, I'm sorry if I needed to start a new post for this, thanks for all your help guys.
Code: Select all
</fieldset>
<?php } ?>
<div>
<input type="checkbox" name="customer_agreed" id="customer_agreed"> I understand and agree to the <a href="/terms/">terms and conditions</a> of this sale.<br><br>
<input type="submit" name="customer_order_new" id="customer_order_new" value="Submit Order">
</div>
</form>
<?php
}Re: About to get fired over this
I suspect you would have to change the:
Do you have some IF statement that is looking for "customer_order_new" ? Something like:
You could either change the existing IF code or rename the 'name=' and then add your new code that sends an e-mail instead.
Please remember I'm new to PHP programming, so my two cents is only worth one cent. : )
Good luck and I'm glad you kept your job..
Code: Select all
name="customer_order_new"Code: Select all
if ($_POST['customer_order_new'])Please remember I'm new to PHP programming, so my two cents is only worth one cent. : )
Good luck and I'm glad you kept your job..
-
lostinthecode
- Forum Newbie
- Posts: 15
- Joined: Fri Oct 08, 2010 1:33 pm
- Location: Fort Smith, Arkansas
- Contact:
Re: About to get fired over this
So basically I need to redefine customer_order_new with code that would send the email instead of sending it to the credit card processing? I am extremely new to eCommerce especially using php so I want to make sure that everything is on the up and up before we start promoting the site. I know of a few ways to code a mailing function, but can anyone help me with which is the most efficient or secure?
Here is the code snippet where customer_order_new is called:
Here is the code snippet where customer_order_new is called:
Code: Select all
}
$cart->saveCart();
if (count($cart->cart_items) > 0) {
$cart->loadItemInfo();
displayCheckoutForm($_POST);
} else {
unset($cart);
header("Location: /");
}
} elseif ((array_key_exists("customer_order_new", $_POST)) && (! empty($_POST["customer_order_new"]))) {
if ((! array_key_exists("customer_agreed", $_POST)) || (strcmp($_POST["customer_agreed"], "on"))) {
echo "<p>You must first agree to the terms and conditions governing the use of this website.</p>\n";
displayCheckoutForm($_POST);
} else {
$custid = 0;
if (! $user->isAuthenticated()) {
if (! empty($_POST["customer_pass1"])) {
if (($cid = $customers->Create($_POST))) {
$custid = $cid;
} else {
echo "<p>" . $_SESSION["msg"] . "</p>\n";
unset($_SESSION["msg"]);
displayCheckoutForm($_POST);
}
}
} else {
$customers->Fetch("customer_user = {$user->user_id}");
$cust = current($customers->customers);
if ($cust) {
$custid = $cust->customer_id;
if (! $customers->Edit($custid, $_POST)) {
echo "<p>" . $_SESSION["msg"] . "</p>\n";
unset($_SESSION["msg"]);
displayCheckoutForm($_POST);
}
} else {
if (($cid = $customers->Create($_POST))) {
$custid = $cid;
} else {
echo "<p>" . $_SESSION["msg"] . "</p>\n";
unset($_SESSION["msg"]);
displayCheckoutForm($_POST);Re: About to get fired over this
I personally wouldn't change anything in that code. Instead - change the ' name= ' to something like:
Then you could do (be sure to expand my example) something like:
Obviously when you got it to work like you want you could change the _test to something more appropriate.
This way you don't mess with any pre-existing code in case you have to go back to it.
Also, you really never said what you wanted the e-mail to do or even why an e-mail at that particular point. I have some e-mail code I could share with you, but really need to know what you're trying to e-mail, so I know if what I have can help you.
Explain the e-mail for us. What are you emailing? Just text or are there attachments? is the email dynamic (i.e. pulling data from db)
Code: Select all
<input type="submit" name="customer_order_new_test" id="customer_order_new" value="Submit Order">Code: Select all
if ($_POST['customer_order_new_test'])
{
send your e-mail code here...
}
This way you don't mess with any pre-existing code in case you have to go back to it.
Also, you really never said what you wanted the e-mail to do or even why an e-mail at that particular point. I have some e-mail code I could share with you, but really need to know what you're trying to e-mail, so I know if what I have can help you.
Explain the e-mail for us. What are you emailing? Just text or are there attachments? is the email dynamic (i.e. pulling data from db)
-
lostinthecode
- Forum Newbie
- Posts: 15
- Joined: Fri Oct 08, 2010 1:33 pm
- Location: Fort Smith, Arkansas
- Contact:
Re: About to get fired over this
Basically instead of submitting the order form it would send the order to an email address for verification and then we would do the credit card authorization in-house as we do not have any kind of online merchant services and we only cater to military and law enforcement customers so we need to be able to review the order and make sure they are who they say they are before we actually process. I hope this explains what I am trying to do with this code. Thanks again guys, this is one of the most helpful forums that I have ever posted on.
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: About to get fired over this
Can I put that in our testimonials?lostinthecode wrote:Thanks again guys, this is one of the most helpful forums that I have ever posted on.
-
lostinthecode
- Forum Newbie
- Posts: 15
- Joined: Fri Oct 08, 2010 1:33 pm
- Location: Fort Smith, Arkansas
- Contact:
Re: About to get fired over this
haha... If you would like to I would be more than happy to be a spokesperson
I am slowly starting to get more comfortable with php and would love to become a helpful addition to this forum.