Skip to content

Tag: php

Transform text coma in an array

I am working with the PayPal API and I am trying to add multiple items to my itemList. My problem is that to make the itemList work, the array needs multiples variables: I am using a loop before, to set-up the items, which I am trying to gather into one variable: It doesn’t work and I think that the pro…

PHP – Can’t log out and show alert message at the same time

I have a PHP login system where you can delete your account/profile if you’d like to. When the user clicks on the button I want them to be logged out, their account to be deleted and an alert message (JavaScript) saying that their account has been deleted. The problem is that the alert message doesn&#82…

How do I pass these variables to another php file

I’m currently making a shopping website and I need to be able to pass two variables to the next page, the code may be badly written because I’m new to this, but I’m trying to pass the number from the drop-down menu and the “row[‘pid’]” to another page. As shown below …

Split VAT into segments based on Country code

What is the best wat to split any VAT number into segments? First part is the country code, is always 2 alphanumeric. Second is the remaining number. For example: NL820471616B01 should be split to NL and 820471616B01 BE0824148721 should be split to BE and 0824148721 ATU12345678 should be split to AT and U1234…

How to redirect PHP page on MySQL database connection failure

Using MySQLi connection method I am trying to redirect page instead of printing out the error message trying to test this out I change the localhost to localhostszzz but I am getting error message of Warning: mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /..…