Jump to content
BulForum.com

PHP problem


JeRou

Recommended Posts

Problema e takyv 4e, kogato puskam tozi skript ne raboti( Kogato napisha First,last name ,age i drugite neshta prosto ne izlizat na drugiq file loan.php) mislq 4e e napisan pravilno. Mojeli problema da e v nepravilno instalirane na PHP vyrho Apache?

V momenta polzvam php-4.3.10 i apache-2.0.52. Mogat da se vidqt na moqt syrvyr: www.hassix.com/loan.html

Tova e ediniqt script.

 

 

------------------------------------------------------

loan.html

-------------------------------------------------------

<HTML>

<HEAD></HEAD>

<BODY>

<B>Namllu Credit Bank Loan Application Form</B>

<FORM METHOD=POST ACTION="loan.php">

First Name:

<INPUT NAME="FirstName" TYPE="Text">

Last Name:

<INPUT NAME="LastName" TYPE="Text">

Age:

<INPUT NAME="Age" TYPE="Text"SIZE="3">

<BR>

<BR>

Address:

<TEXTAREA NAME="Address" ROWS=4 COLS=40>

</TEXTAREA>

<BR>

<BR>

What is your current salary?

<SELECT NAME="Salary">

<OPTION VALUE=0>Under $10000</OPTION>

<OPTION VALUE=10000>$10,000 to $25,000</OPTION>

<OPTION VALUE=25000>$25,000 to $50,000</OPTION>

<OPTION VALUE=50000>Over $50,000</OPTION>

</SELECT>

<BR>

<BR>

How much do you want to borrow?<BR><BR>

<INPUT NAME="Loan" TYPE="Radio" VALUE=1000>Our $1,000 package at 8.0% interest

<BR>

<INPUT NAME="Loan" TYPE="Radio" VALUE=5000>Our $5,000 package at 11.5% interest

<BR>

<INPUT NAME="Loan" TYPE="Radio" VALUE=10000>Our $10,000 package at 15.0% interest

<BR>

<BR>

<INPUT TYPE=SUBMIT VALUE="Click here to Submit application">

<INPUT TYPE=RESET VALUE="Reset application form">

</FORM>

</BODY>

</HTML>

 

--------------------------------------------------------------

loan.php

--------------------------------------------------------------

<HTML>

<HEAD></HEAD>

<BODY>

<B>Namllu Credit Bank Loan Application Form</B>

<BR>

<BR>

<?

$SalaryAllowance = $Salary/5;

$AgeAllowance = ($Age/10 - ($Age%10)/10)-1;

$LoanAllowance = $SalaryAllowance * $AgeAllowance;

echo "Loan wanted:$Loan<BR>";

echo "Loan amount we will allow:$LoanAllowance<BR><BR>";

if ($Loan <= $LoanAllowance) echo "Yes, $FirstName $LastName, we are delighted to

accept your application";

if ($Loan > $LoanAllowance) echo "Sorry, $FirstName $LastName, we cannot accept

your application at this time";

?>

</BODY>

</HTML>

--------------------------------------------------------------------

Link to comment
Share on other sites

Сложи extract($_POST); примерно в началото и ще стане. Относно къде бъркаш - май изобщо си се объркал с тва ПХП :)

Link to comment
Share on other sites

pitai

Яко жици.... says:

zna4i

Яко жици.... says:

imam XOOPS

Яко жици.... says:

pitai

Яко жици.... says:

ot kade se nastroivat linkovete

 

 

nqkoi da znae ?

6toto az i predstava si nqmam kakvo e xoops

Link to comment
Share on other sites

Както ти показа sasquatch, проблемът е, че в конфигурацията на PHP на сървъра е забранена регистрацията на глобалните променливи (register_globals = Off).

Единия начин е чрез споменатия оператор да подготвиш променливите си в началото на всеки файл, който се извиква от форма (и още един ред за всеки случай: extract($_GET); ), или в php.ini да включиш регистрацията им, т.е. да промениш реда с

register_globals = Off

на On. Така си спестяваш редактиране на доста файлове, но това е в случай, че сървъра е под твой контрол.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...