Jump to content

sgt_fireman

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Everything posted by sgt_fireman

  1. Thank-you BuildMyWeb, That worked fine!
  2. Hey guys, so I was trying to create something that very simply gets the file extension for me, however for some reason the output of $xnt is the first letter of the uploaded file, and not the extension, Any Ideas anyone? Thank-you very much in advance. $path2 = $_FILES['uploadedfile']['name']; $xnt = ($path2['extension']); echo $xnt; die();
  3. I've found a possible other way of doing it.. Does anyone know if you can use $_SERVER['HTTP_REFERER'] to only echo a site domain? because with no other code, just by redirecting to a page and having echo $_SERVER['HTTP_REFERER']; on the page it gets the full domain of the page the user was on, it doesn't matter by the way if anyone can just type the URL in because no functions will happen unless the url excists in the database, anyway back to the question, does anyone know how to make the $_SERVER['HTTP_REFERER'] function only output the domain, for example I want the example.com not the example.com/testpage.php Thanks again guys,
  4. Well, It's an advertising system that I've been setting up for the past few weeks, This is literally the last thing before completion, however when an image is pressed it already takes the money off the right account, but next it has to pay the right account, and to do this it must have some way of identifying the account, so in the MySQL database, there is a column for the website's domain, So my plan was to create a session on the original page with the advert on containing the website's domain name, then carry this to the engine, and basically say, WERE site = $_SESSION['site']; or whatever, then add the money that we owe them... and then I've recently realized, you ofc can't send session variables from one server to another, so this is why I'm searching for an alternative,
  5. Okay, I'll take a look into both of these now, Thank-you very much for the fast reply!
  6. Hello guys, so quite simply I've created a rather large PHP file for my website, everything works fine but for the last thing I need to basically take a session variable that a site sets, and be able to access it on the page of my other site that it re-directs to, I know this isn't possible because they're on different servers, and I can't use the database alternative of setting the value in a database and relaying it when I get to the other site because the piece of code that's on the first server is to be posted on a lot of websites, And I of course don't want my MySQL database details going out to other websites, So... anyone know any alternatives of transferring session variables? or alternatives to using session variables? Thank-you very much guys.
  7. I've managed to get it working with $_SERVER['SERVER_NAME'], Thank-you very much guys, and thank's florida.
  8. I'm afraid that's just outputting a forward slash florida, and christian, because it's going into an automated system I do just need the URL alone, but I shall take a look in the PHP manual, thanks, while I'm searching, anyone else know any alternatives?
  9. Hey guys, So I'm wanting to get the site URL, but only the domain name part... for example, if the page a user was on is, I'de want to just be able to get the part, without the test.php, Up to now I've tried both $_SERVER["REQUEST_URI"] and $_SERVER["PHP_SELF"] however these both just output the test.php part, I don't know any more things that could do this.. and I can't find any of them on google so? Does anyone know anything about doing this? Thanks for the help guys!
  10. Okay thanks christian, on another note, as I said on the OP, how exactly would I include another servers file if it were to be the method I chose?
  11. Additional information: I own the server that holds the file to include, and the file is basically designed to be ran on other pages... is there some way of enabling the one file to be ran on other servers? If you haven't guessed by the way, I'm clueless on this topic.
  12. I was trying to get it to run the code in the php file :/ does this mean it's not possible?
  13. Hey guys, So I need to try and create an equivalent of doing, <? include ("http://www.example.com/example.php")?> Now I know this isn't possible to just use the code above (At least I've been told) So does anyone know any alternatives? Thanks very much in advanced guys.
  14. Hey guys, So i've made quite a simple script that merges 3 images: A logo, background, and some text. <?php session_start(); $Bg = ($_POST['bg']); $Logo = ($_POST['logo']); $Text = ($_POST['text']); $bg = imagecreatefrompng('$Bg'); $fg = imagecreatefrompng('$Logo'); $Final = imagecreatefrompng('$Text'); $x = imagesx($bg); $y = imagesy($bg); imagecopy($bg, $fg, 0, 0, 0, 0, 728, 90); imagecopy($Final, $bg, 0, 0, 0, 0, 728, 90); header('Content-Type: image/png'); $UID = "test"; $Path = 'test/' . $UID . '.png'; imagepng($Final); imagepng($Final,$Path,9); imagedestroy($bg); imagedestroy($fg); imagedestroy($Final); ?> Now this works fine but I'de like to create it so that users can upload the 3 images to merge, Is there anyway to link a script like this to a form? Thanks very much guys.
  15. Ahh thanks jazzman, I removed line 36 and It told me that I had named something wrong, I've changed it and re-added line 36 and It's working fine! Thank-you very much!
  16. <?php session_start(); include ("../config.php"); mysql_query("UPDATE statistics SET views=views+1 WHERE id = 1") or die (mysql_error()); include ("../config2.php"); $ADI = $_SESSION['ADI']; $y = mysql_query("SELECT SiteURL FROM Users WHERE UID='$DI'") or die(mysql_error()); $z = mysql_fetch_array( $y ); $SITE = $z['SiteURL']; $SITE2 = 'http://' . $SITE . ''; $IP = $_SERVER['REMOTE_ADDR']; $namef = "counter.txt"; $handlef = fopen($namef, 'r') or die ("zero"); $counter = fread($handlef, filesize($namef)); fclose ($handlef); $counter = $counter + 1; $namef2 = "counter.txt"; $handlef2 = fopen($namef2, 'w') or die ("zero"); fwrite($handlef2, $counter); fclose ($handlef2); $final = $counter . ")" . $IP . "<br />"; $name = "iplist.html"; $handle = fopen($name, 'a') or die ("0"); fwrite ($handle, $final); fclose ($handle); $DI = $_SESSION['DI']; $p = mysql_query("SELECT * FROM Users WHERE id = '$DI'") or die(mysql_error()); $m = mysql_fetch_array( $p ); $F = $m['F']; $A = $m['A']; $e = $m['e']; // LINE 36 HERE if ($F >= $AV) { $F2 = $F - $e; mysql_query("UPDATE Users SET F=$F2 WHERE id = '$DI'") or die(mysql_error()); $done = 1; } if($A >= $e and $done == 0) { $A2 = $A - $e; mysql_query("UPDATE Users SET A=$A2 WHERE id = '$DI'") or die(mysql_error()); } header("location: $SITE2"); ?> There you go:) I'm prittey sure there is no syntax errors however
  17. Just a config.php and that contains no syntax erros config.php <?php mysql_connect("localhost", "XXXX", "XXXX") or die(mysql_error()); mysql_select_db("XXXX") or die(mysql_error()); ?>
  18. And It's named return.php, Thanks for replying by the way
  19. It's the one with the comment on, $e = $m['e']; // LINE 36 HERE
  20. Hey guys, I'm kind of new to PHP so it's probablly something simple, My error is this on line 36 there is this, $A = $m['A']; $e = $m['e']; // LINE 36 HERE if ($F >= $AV) { $F2 = $F - $e; mysql_query("UPDATE Users SET F=$F2 WHERE id = '$DI'") or die(mysql_error()); $done = 1; } if($A >= $e and $done == 0) { $A2 = $A - $e; mysql_query("UPDATE Users SET A=$A2 WHERE id = '$DI'") or die(mysql_error()); } So I'm not really sure what's wrong, I've checked a few sites and I think I'm using the right syntax? Thanks very much guys!
×
×
  • 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.