I'm trying to build an exchange website which hosts items that other people are selling. I want the site to show the prices that people are selling at but will not see their contact information until they pay a certain amount. I obviously want to make sure that the page is completely inaccessible by those who haven't paid. In addition, it would be convenient if it could also have a 30 day access period or a certain number of views for the user who has paid.

Can anyone recommend a php-based script or anything else I can use in order to make these features possible?

Dani AI

Generated

Short answer: treat seller contact details as protected content behind a server-side paywall and implement payment-confirmation + an access record per buyer. As suggested, break the work into small components and build each one (authentication, payment, access control) instead of hunting for a single turnkey script.

Practical component list:

  • Authentication: require buyers to register (or create a verified guest account) so purchases attach to a user.
  • Listings: store seller contact separately from public fields; encrypt contact info at rest and never include it in HTML for unpaid users.
  • Payments: integrate a processor (Stripe or PayPal) and use server-side webhooks to grant access only when the payment is confirmed.
  • Access records: a purchases table with fields like user_id, listing_id, expires_at, remaining_views, transaction_id.
  • Middleware/check: every request for contact info must validate the purchase record and deny access server-side.

Use an atomic DB update to enforce view limits and avoid race conditions. For example:

UPDATE purchases
SET remaining_views = remaining_views - 1
WHERE id = :id
  AND remaining_views > 0
  AND (expires_at IS NULL OR expires_at > NOW())

Then allow access only if the update affected a row.

Important cautions and tips:

  • Do not rely on client-side hiding (CSS/JS); remove contact data on the server for unpaid users.
  • Verify payment webhooks (signature checks) before granting access; see Stripe webhooks for best practice ().
  • Avoid caching responses that contain contact info (use Cache-Control: private, no-store) so proxies/CDNs do not leak data.
  • Never store card data yourself; follow PCI guidance and use the payment provider’s checkout or tokenization.
  • If you want a faster route, use a PHP framework (Laravel + Cashier) or a CMS with membership plugins, but plan to customize the access-record logic above.

For session and server-side auth basics see the PHP sessions manual (PHP sessions manual).

Recommended Answers

All 3 Replies

What you are asking is very specific. I do not think you'll find many scripts out there that you can just slap together to get this to work. I also doubt that anyone on this site is just going to develop a web application for you based on your description.

I would suggest that you start building the site and build each component. As you get stuck, as for help on that specific item.

i m degree holder of mcs

m. shahzad

permission to listening

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.