Skip to content

Tag: php

Redirect based on the ?id= parameter in the url

I have a login system that I build in PHP and MySQL. if any of my users log in they get directed to the user.php page I have an authenticate.php page that redirects the user based on their ID to a page. This is the code that adds the id to the URL: header(“Location: user.php?id=”.$id); ) Can I wri…

Hide or show input on dropdown selection

I am trying to create a sign-up page for my app. All the code works, but when I try to hide input box based on dropdown select, it doesn’t work. I tried this: But it didn’t work. And this is my code for the signup page: Answer It does work, you only need to place the script underneath the form

Dynamic Div Tags in a While Loop

I have a while loop that populates 4 div tabs (in one parent div) with PHP. I also have a copy-to-clipboard script to copy text from a P tag. Unfortunately, this function works only if the tag and button have a unique Id. So my question is this: How do I assign a sequential Id to my looped P tags?

How to select multiple class class with same name in JS

I use PHP to dynamically render these lists that I fetched from the database, and each one has the same class, because I can’t change it, it renders dynamically. I select these classes via JavaScript and create an event on click to open and close them with the hidden class. Now I have a problem, this ev…

How to pass order ID to Paypal Button?

I create an order by my php sdk. like this and now i have this order id. but … How to pass order ID to Paypal Button? like this Answer Create two routes on your server, one to create an order (and return the resulting JSON), and one that takes an order id as a parameter and captures it (and