X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Please help! i'm really stuck!! Pleaseee (https://forum.x-cart.com/showthread.php?t=9921)

x-online 10-19-2004 09:46 PM

Please help! i'm really stuck!! Pleaseee
 
Hi all,

My issue is .. i try to create a similar page which is same as contact us but has more questions in it.

My problem is it can not send. it just looping back..

What i found.. i think this is the key!
help/contactus.tpl
Code:

{capture name=dialog}
{if $smarty.get.mode eq "update"}
<table width=100% border=0 cellspacing=0 cellpadding=2>
<form action="help.php?section=become_a_reseller&mode=update&action=contactus" method=post name=registerform>


well as i rename it to become_a_reseller.tpl
and it just not send... Please advice!!!!
thanks you in advance.

shan 10-20-2004 03:07 AM

Code:

<form action="help.php?section=become_a_reseller&mode=update&action=contactus" method=post name=registerform>

did you update the php file too

x-online 10-20-2004 03:38 AM

Thanks shan
 
Shan,

Thanks for dropping by.

here is the php code:
Code:


# $Id: help.php,v 1.33.2.1 2004/02/05 12:25:46 mclap Exp $
#

if ( !defined('XCART_SESSION_START') ) { header("Location: ../"); die("Access denied"); }

if (!empty($login))
  $userinfo = func_userinfo($login,$login_type);

if (empty($section)) $section = "";

if ($REQUEST_METHOD=="POST" and $action=="contactus") {
#
# Send mail to support
#
  $HTTP_POST_VARS["body"] = stripslashes($HTTP_POST_VARS["body"]);

  while (list($key,$val) = each($HTTP_POST_VARS))
      $contact[$key]=$val;

    $fillerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["b_address"]) || empty($contact["b_city"]) || empty($contact["b_country"]) || empty($contact["b_zipcode"]) || empty($contact["phone"]) || empty($contact["email"]) || empty($contact["subject"]) || empty($contact["body"]));

  if(!$fillerror) {
      $contact["b_statename"]= func_get_state($contact["b_state"], $contact["b_country"]);
      $contact["b_countryname"]= func_get_country($contact["b_country"]);

      $mail_smarty->assign("contact",$contact);

      func_send_mail($config["Company"]["support_department"], "mail/help_contactus_subj.tpl", "mail/help_contactus.tpl", $contact["email"], true);

      func_header_location("help.php?section=contactus");
  } else {
      $userinfo = $HTTP_POST_VARS;
      $userinfo["login"] = $userinfo["uname"];
  }
}

if ($REQUEST_METHOD=="POST" and $action=="become") {
#
# become a reseller
#
  $HTTP_POST_VARS["body"] = stripslashes($HTTP_POST_VARS["body"]);
  while (list($key,$val) = each($HTTP_POST_VARS))
      $contact[$key]=$val;
    $fillerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["b_address"]) || empty($contact["b_city"]) || empty($contact["b_country"]) || empty($contact["b_zipcode"]) || empty($contact["phone"]) || empty($contact["email"]) || empty($contact["subject"]) || empty($contact["body"]));

  if(!$fillerror) {
      $contact["b_statename"]= func_get_state($contact["b_state"], $contact["b_country"]);
      $contact["b_countryname"]= func_get_country($contact["b_country"]);
      $mail_smarty->assign("contact",$contact);
      func_send_mail($config["Company"]["support_department"], "mail/help_contactus_subj.tpl", "mail/help_contactus.tpl", $contact["email"], true);
      func_header_location("help.php?section=become_a_reseller");
  } else {
      $userinfo = $HTTP_POST_VARS;
      $userinfo["login"] = $userinfo["uname"];
  }
}
#
# Recover password
#
if ($REQUEST_METHOD=="POST" and $action=="recover_password") {

$accounts = func_query("select login, password, usertype from $sql_tbl[customers] where email='$email' and status='Y'");

#
# Decrypt passwords
#
if($accounts) {
  foreach($accounts as $key=>$account)
      $accounts[$key]["password"]=text_decrypt($accounts[$key]["password"]);

        $mail_smarty->assign("accounts",$accounts);

        func_send_mail($email, "mail/password_recover_subj.tpl", "mail/password_recover.tpl", $config["Company"]["support_department"], false);

        func_header_location("help.php?section=Password_Recovery_message&email=".urlencode($email));
}
else
        func_header_location("help.php?section=Password_Recovery_error&email=".urlencode($email));

}

if ($section=="contactus" ) {
  include $xcart_dir."/include/states.php";
  include $xcart_dir."/include/countries.php";
}
if ($section=="become") {
  include $xcart_dir."/include/states.php";
  include $xcart_dir."/include/countries.php";
}

$smarty->assign("userinfo",@$userinfo);
$smarty->assign("fillerror",@$fillerror);

$smarty->assign("main","help");
$smarty->assign("help_section",$section);

?>


i actually got this code for help/become_a_reseller.tpl:
Code:

<form action="help.php?section=become_a_reseller&mode=update&action=become" method=post name=registerform>

and i can't see why it's not working if i do exactly the same?

x-online 10-21-2004 09:11 PM

Hi..
 
Please... anyone?

Gijs 10-21-2004 09:30 PM

hi x-online,

Code:

<form action="help.php?section=become_a_reseller&mode=update&action=contactus" method=post name=registerform> 

Code:

if ($REQUEST_METHOD=="POST" and $action=="become") {
#
# become a reseller
#


There is a contradiction in the $action.

H.I.H.

x-online 10-21-2004 09:42 PM

Thanks Gijs,

My site won't be live for another month also and i am afraid of forgeting putting your content on it.

with the questions i got..
i actually got this one tho..
Code:

<form action="help.php?section=become_a_reseller&mode=update&action=become" method=post name=registerform>

but it still not working.

:(

pmstudios 10-22-2004 04:25 AM

Looks like you're not specifying $action to be a GET variable

Add this to the top of your php file:
Code:

$action = $_GET['action'];


Otherwise it's being treated as a POST variable :)

x-online 10-22-2004 04:39 AM

thanks
 
Thank you,

i will give this a go now ^_^

will come back and post the result.

Really appreciated for dropping by.

poy

x-online 10-22-2004 06:06 AM

Did the test
 
Hi,

I did the test but no success.
It kinda weird.. logicly.. it should work like snap! but it's not.
Thanks you for everyone who putting they effort to answer my queston tho!

thanks. :cry:

pmstudios 10-22-2004 06:34 AM

Re: Did the test
 
Quote:

Originally Posted by x-online
Hi,

I did the test but no success.
It kinda weird.. logicly.. it should work like snap! but it's not.
Thanks you for everyone who putting they effort to answer my queston tho!

thanks. :cry:


Try $HTTP_GET_VARS instead of $_GET ?

Gijs 10-22-2004 12:22 PM

it's friday night and I'm p*ssed again
 
Quote:

Originally Posted by pmstudios
Looks like you're not specifying $action to be a GET variable. $action = $_GET['action']; Otherwise it's being treated as a POST variable :)

That is it: it a $_post :!: :!:

Code:

method=post
At the limit you could use $request, but i think the problem with the it has nothing to do with it.
Unless it's an x-cart feature :twisted: :twisted: :twisted:

I've receieved the 3.5x code from x-online and try to reconstruct this for 4.xx tomorrow ... at least when I'm sober :roll: :roll:

pmstudios 10-22-2004 01:01 PM

Re: it's friday night and I'm p*ssed again
 
Quote:

Originally Posted by Gijs
... at least when I'm sober :roll: :roll:


That explains why I have trouble deciphering some of the things you say! :P

Gijs 10-22-2004 08:10 PM

Re: it's friday night and I'm p*ssed again
 
Quote:

Originally Posted by pmstudios
Quote:

Originally Posted by Gijs
... at least when I'm sober :roll: :roll:


That explains why I have trouble deciphering some of the things you say! :P


No :!: No :!:
Even when I'm sober, you'll have the same trouble :wink:

pmstudios 10-22-2004 11:24 PM

Re: it's friday night and I'm p*ssed again
 
Quote:

Originally Posted by Gijs
No :!: No :!:
Even when I'm sober, you'll have the same trouble :wink:


I suppose it doesn't help me being awake 19-20 hours a day for the past week either ;)


All times are GMT -8. The time now is 03:10 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.