Jump to content

wkdw1ll1ams

Members
  • Posts

    44
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

wkdw1ll1ams's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. When the hell did i ask you to write my code, trying to be a smartass won't help my situation. I've found what i was looking for so you might aswell close this.
  2. Sorry, Could you post some code of how you would do it so i have a better understanding of this number_format thing. When i started php yesterday, i was surprised of the similarities of c++ (I'm a cpp programmer) so i guess php will be easy to understand because of this.
  3. If you put a "0.10" behind $num1 it would result in 100.10. I *think* what you are wanting to do is treat $num1 as a percentage. So, $num1 * $num2 = (0.10) * 10 = 1. Is that correct? Then this is simple math and not a coding issue: $num1 = 10; $num2 = 10; $result = ($num1/100) * $num2; echo $result; That is for adding a percentage, I'm trying find the percentage of a number. for example, what is 50% of 100: 0.5x100 = 50 I think I've found what i was looking for anyway. $number3 = 50; $number4 = 100; $number3 /= 100; $number1 = $number3 * $number4 echo "<script>alert('$number3 is $number1 as a percentage')</script>"; } ?> Because I'm a beginner php programmer, i can't find a better way. P.S that code works.
  4. Let's say i have this code: <? $num1 = 10; $num2 = 10; echo $num1 * $num2; ?> How do i put a "0.10" behind $num1 so it will become 0.10? I was thinking something like this: <? $num1 = 10; $num2 = "0." $num3 = $num2,10; echo $num1 * $num3; ?>
  5. edit: i have this code: <?php $content = <<<EOL <head> </head> <body> New page </body> </html> EOL; $file = "page.php"; $open = fopen($file, "w"); fwrite($open, $content); fclose($open); ?> i could edit the $file to create a page for each film.
  6. just to clarify the site is like imdb, its not a pirate site for films. i thought this would be good to make to learn php. i have a bunch of folders in /films/ and the folders in there are all film names like /films/aliens/. how would i automatically create a php page for each folder and url would be like "localhost/films.php?id=12" trying to understand me here maybe hard, but i appreciate you trying.
  7. i have a folder called films with a bunch of films and ive tried blocking none logged in users from the films but they can easily copy the link location and make it a direct link. how do i stop this?
  8. Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\index.php on line 3 php is a pain
  9. im not firmiliar with $_session but i just get an error: Notice: Undefined variable: _SESSION in C:\xampp\htdocs\tvshows.php on line 2
  10. ive attached the login files in a zip archive for you to understand more of how the code works. [attachment deleted by admin]
  11. i got my user login and register working with my sql but now if a non logged in user tries to access the shoutbox i want it to redirect them to the register page. <?PHP session_start(); if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) { header ("Location: /login/main.php"); } ?> im using that code but even if im logged in, it redirects me to the register page? my main site is on the root of the site. the login page and the logged in page is in "/login/
  12. i scanned my website with acunetix and its telling me the vulnrability is HIGH SSL 2.0 deprecated protocol "Server" SSL weak ciphers "Server" SSL weak ciphers "Server" SSL weak ciphers "Server" how do i fix this exploit?
  13. oh i see silly me special thanks to WebStyles for the lesson
  14. your code was using "echo" and i understand that, but my code is different.
×
×
  • 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.