is there any one with an idea of how to link a php form where by a customer places an order when the click clicks submit order data is verified,sent to database and then linked to SWREG
i have implemented the order form, verification and sending data to the database. in addtion the form is linking to the SWREG but the total payment is not being transfered. Any one with an experience in php forms and SWREG CAN HELP me please.

Dani AI

Generated

@cikonyo

Likely causes (in order to check)

  • The query parameter name or format is wrong (spaces in a name break servers; SWREG expects a specific field name and format).
  • The value is not URL-encoded or contains currency symbols/commas.
  • The PHP that builds the link is not being executed (page not served as PHP) or output is malformed.
  • The SWREG product is not configured to accept a variable price, so the platform ignores the passed price.

Practical steps to fix and test

  • View source of the page the browser receives. Confirm the generated URL contains the numeric price (no extra quotes, no PHP tags visible).
  • Ensure the price is a plain number (e.g. 12.50), not USD 12.50 or 12,50.
  • Build the query properly in PHP and URL-encode values. Example pattern:
<?php
$params = [
  's' => '133537',
  'p' => '133537-2',
  'q' => 1,
  'v' => 0,
  'd' => 0,
  'VariablePrice' => $price  // use the exact name SWREG requires
];
$url = 'https://usd.swreg.org/cgi-bin/s.cgi?' . http_build_query($params);
header('Location: ' . $url);
exit;
?>
  • If SWREG requires POST, create a form with hidden inputs (same parameter names) and auto-submit it from PHP/JS instead of using a GET link.
  • Log or echo the built URL on your server during testing to confirm the price is present before redirecting. If using header('Location: ...'), make sure nothing has been output beforehand.

Final checks

  • Confirm the exact parameter name and whether variable pricing must be enabled for that product in your SWREG account (check the merchant settings).
  • Test with a hard-coded price first. If that works, the problem is in how $price is produced or encoded.
  • Keep the client-sent price for display only; for security, validate and/or re-calculate the final amount server-side before sending customers to SWREG.

Recommended Answers

All 5 Replies

Member Avatar for Member #120589

SWREG?? What's that?

just Google and get to learn everything by yourself. its an online payment method anyway.

you could do the same:

Member Avatar for Member #120589

Here I was waiting to help ... Oh well... Another one for the list I suppose :(

thanks for suggesting the guide. i have followed it to the letter. However, am experiencing a problem in passing variable price from the php form to SWREG using the url parameter
this is the url i have
https:"// Pricing=<?php echo"$price";?>"
The url is linking the form to SWREG but it doesn't transfer the price. please help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.