/    Sign up×
Community /Pin to ProfileBookmark

Please help with my problem!!

Hi, I am not an expert on PHP at all so please bare with me. What i want is for people to be able to type in a invoice number and auth code in to 2 input fields and press submit…this will then take them to their own online payment invoice which they can then pay online. a bit like this [url]www.zensecure.com[/url]

So for example. They type in invoice number 200 and the auth code will be 24954 they would then be redirected to that invoice.

So basically i need a redirecting script which i can control…so for each different input combination i can enter the URL for each to redirect to.

thanks

to post a comment
PHP

10 Comments(s)

Copy linkTweet thisAlerts:
@so_is_thisOct 31.2006 — Just include a redirect code column in the invoice table -- so that when you look up the invoice, you can also look up (in a lookup table) the URL associated with the redirect code. The following presumes that all three of the referenced columns contain numeric data:
[code=php]
$sql = "Select * from invoices as t1".
" Left Join redirects as t2".
" on t1.redirect = t2.redirect".
" Where t1.invoice = {$invoice}".
" and t1.authcd = {$authcd};"[/code]
Copy linkTweet thisAlerts:
@jaimewebauthorOct 31.2006 — Hi,

Sorry i do not understand that at all...
Copy linkTweet thisAlerts:
@so_is_thisOct 31.2006 — Are you using a database for your invoices?
Copy linkTweet thisAlerts:
@jaimewebauthorOct 31.2006 — no what i am doing and want to continue doing is i generate a paypal page for the amount due. All i want is for when they type the indivual invoice number and indivdual auth code (which i will add each time a new invoice is sent out) it will send them to the paypal url i have linked to that combination.

a bit like a passowrd protected area but each user can be redirected to a different url
Copy linkTweet thisAlerts:
@so_is_thisOct 31.2006 — Well, if you're not wanting to use a data file, then perhaps you can merely add on to an array (and have to search the array) or a basic switch structure:
[code=php]
switch ($invoice)
{
case '200': if ($authcd == '24954') $url = 'someurl'; break;
case ...etc...
default: echo 'Error in input.'; exit;
}
header('Location: '.$url);[/code]
Copy linkTweet thisAlerts:
@jaimewebauthorOct 31.2006 — Could i do it from a text file? which i could update, instead of having a huge webpage code?

Also couold you give me the whole code as i have no idea how to incorporate the code you gave into a form...
Copy linkTweet thisAlerts:
@netbuddyOct 31.2006 — no what i am doing and want to continue doing is i generate a paypal page for the amount due. All i want is for when they type the indivual invoice number and indivdual auth code (which i will add each time a new invoice is sent out) it will send them to the paypal url i have linked to that combination.

a bit like a passowrd protected area but each user can be redirected to a different url[/QUOTE]


Use PHP to generate and insert the relavent data into a form and have javascript submit the form when the user verifies that the totals are correct.

You wouldnt need a email or database because paypal will send you and the customer a copy of the transaction.

I wrote a paypal generator in javascript, so I dont see why it cant be done in PHP with a little help with posting to paypal using javascript.
Copy linkTweet thisAlerts:
@so_is_thisNov 01.2006 — Could i do it from a text file?[/QUOTE]
Sure. Howsabout a CSV file?

invoices.csv200,24954,"someurl"
...etc...

invoices.php[code=php]$fp = fopen('invoices.csv', 'r');
while($row = fgetcsv($fp, 200))
{
if($row[0] == $invoice && $row[1] == $authcd)
{
$data = $row;
break;
}
}
fclose($fp);
if(!$data)
{
echo 'Error in input.';
exit;
}
header('Location: '.$data[2]);
exit;[/code]
Copy linkTweet thisAlerts:
@jaimewebauthorNov 01.2006 — Hi thanks for all your help. But i still have no idea how i would set that up so i have 2 textbox's (invoice number input and auth code input) and a submit button...

?

Thanks!!!!
Copy linkTweet thisAlerts:
@jaimewebauthorNov 02.2006 — Anyone? ??
×

Success!

Help @jaimeweb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...