Jump to content

insidus

Members
  • Posts

    33
  • Joined

  • Last visited

About insidus

  • Birthday 02/28/1991

Profile Information

  • Gender
    Male
  • Location
    England

insidus's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This might not an elegant solution.. But you could send the form to mail.php and send the mail, thenuse CURL to send the information to PayPal. http://stackoverflow.com/questions/3080146/post-data-to-url-php
  2. I think instead of \n its \r\n. You could always print them inside <pre> tags, or use var_dump(), which will print the information + a little more on separate lines. edit. or simply use <br /> tags
  3. Not a problem, glad I could help Can you set this thread as 'answered'? /Insidus
  4. The first thing you should do before the if(isset($_POST['posted'])) ​Is add this line var_dump($_POST['posted']);
  5. Cookies can be a pain when debugging. Cookies that are set on a PHP page, at the start, end or middle cannot be used in that 'load' of the page, to get the client to send cookie data to the server to be processed you will have to do a page reload. Once a cookie has been set in your browser, you either need to create a PHP script to destroy the Cookie, setcookie("user", "Alex Porter", time()-3600); - "time()-3600", or delete the browsers cookie/session data. If you wanted to set a cookie, and use its data straight away, you should either use the variable that you used to set the cookie in the first place within the rest of your code. Set the cookie, for a page reload with header('location: page location'). Or set the data into a session aswell and call that instead. Hope that helps a little. /Insidus
  6. Your not far off! have alook at this and try to figure it out. $totalPrice = 0; echo "<table border='1'> <tr> <th>Product</th> <th>Quantity</th> <th>Price (£)</th> </tr>"; while($column = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>" . $column['Product'] . "</td>"; echo "<td>" . $column['Quantity'] . "</td>"; echo "<td>" . $column['Price'] . "</td>"; echo "</tr>"; $totalPrice += $column['Price']; } echo "</table>"; echo $totalPrice; Start by initiating a variable to hold the total price before the while loop. Inside the while loop, after you print the table row, increment the total price by column['price']. Once outside the while loop, echo the total price out. $totalPrice += $column['Price'] is the same as $totalPrice = $totalPrice + $column['Price'];
  7. So for my website, i have a folder structure of /styles/ /js/ /includes/ etc. if i navigate to those folder locations in the url, it shows a file/directly listing of whats inside. Is there a way of throwing a 404 error if they are accessed? or do i have to do it by using a index.php file? /insidus
  8. Is the PHP version the same as your previous host?
  9. That works if your funding a percent off 100. But say if you wanted 40 percent of 60. 60/40 = 1.5. But I'd you get 1% first by 60/100 = 0.6, then * 40 = 24. By working out 1%, you can times it to find any percentage
  10. Try logging in with the user you in phpmyadmin, then run a simple query on the database, if that succedes then it is the script.
  11. The user doesn't exists in MySql, if you have Phpmyadmin installed, go to Privileges and make sure the user 'user_name' actually exists, has the CORRECT password, and have access to the database your trying to query. the error is Access denied for user 'user_name'@'localhost', which means you have an error with the user trying to connect.. either it doesn't exists, or the credentials are wrong. /insidus
  12. to get 1% of a number, in a normal maths sum, you would do Number / 100 this gives you 1%, then * 10 for 10%, or *50 for 50%. so you would do $percent = 10; $commission = (($row['price'] /100) * $percent); echo "You get: " . $commission . " (10%)";
  13. Turns out, i needed to include -MultiViews in the .htaccess file to get that bit working, but now for my production site, if i do RewriteRule ^view_job/([0-9]+)$ ./view_job.php?job_id=$1 [L] It loads the page, with the correct 'job', but it doesnt load the CSS file? surely its not needed to make a rewrite to the css aswell?
  14. The % in most programming languages isn't a percentage, instead, its modulus/remainder $a % $b Modulus Remainder of $a divided by $b. So to work out percentage, its what the OP said
  15. http://insidus.co.uk/pretty/?id=2 Works, so it seems to be with the GET statement maybe?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.