Jump to content

WolfRage

Members
  • Posts

    647
  • Joined

  • Last visited

    Never

Everything posted by WolfRage

  1. Although Drupal may not have this exact functionality, it is as close as you are going to get. It is excellent at linking forums and their corresponding website(s) and other data all together as an entity. It also provides the most flexibility and automation of any system I have seen. http://drupal.org/
  2. You need to use JavaScript to refresh that other page. PHP is doing everything right, but it can not force the client to refresh the page.
  3. Well sounds like your provider is corrupting the data. But you might want to make sure that your connection to there server is using the right encoding like UTF-8. What uploader are you using? If you are not using you might want to try Filezilla, then you can see it communicate with the server to ensure correct encoding. readfile() reads a file and outputs it directly to the output buffer. Thus you can have a user download a file with out ever having direct access to it. http://www.php.net/manual/en/function.readfile.php
  4. Take a look at this and see if it helps you out. Trust me it will help you out, but you need to read it through. http://www.phpfreaks.com/forums/index.php/topic,259701.0.html
  5. Have you tried to perform a readfile() on the file and provide your own headers. Then it does not matter if the provider supports that file type or not. So long as they are not corrupting the file. If that is the case can you FTP the file back to your computer and still open it successfully?
  6. Analytics is primarily a JavaScript application. You can not interact with it on the serverside using PHP. But if you are going to interact with it you can use a home built API like this one. http://www.electrictoolbox.com/google-analytics-api-and-php/
  7. Don't you need to check prior to the foreach?
  8. You are missing $mtype which is an expected variable with in the method AddMem(). It is the 7th variable out of 13 expected for that function. Edit: To avoid the headers error, you need to remove your print_r() statement.
  9. I have no idea what is wrong and what you want, be more specific, show us some more code and walk us through your logic and expected out come, then you will be helped.
  10. You put the print_r() inside of exit. Data was returned by the print_r() thus exit() is a function that will return FALSE which is the same as 0 or TRUE which is the same as 1. So instead do the print_r() before the exit(), and do not put any code inside the exit() function.
  11. http://www.phpfreaks.com/forums/index.php/topic,262956.msg1240983.html#new
  12. Let's see the form, sounds like your form is incorrect. Also you need to look into security of that form or else you will get hacked. Never trust client input!
  13. http://phpsec.org/ http://us2.php.net/manual/en/security.variables.php http://shiflett.org/articles/input-filtering http://shiflett.org/articles/sql-injection And in General this site has a lot of good security knowledge on it with pratical examples. http://shiflett.org/articles Specific things you can use to filter data. http://us2.php.net/manual/en/function.htmlentities.php http://us2.php.net/manual/en/function.htmlspecialchars.php
  14. That sounds rather unsecure. Also what if I make changes to my account and my friend makes different changes to my account at the same time, who wins and how will your system take care of different requests for the same accounts?
  15. Ok so regular expression matching blows my method out of the water. But this is what I had come up with so far although far from perfected. <?php $www=array('www','www1','www2'); $tld=array('co','com','uk','net','org','us','biz'); $url = 'http://www2.site.com'; // Split link to just get domain name function parse_url_domain ($url) { $parsed = parse_url($url); return $parsed['host']; } $url=parse_url_domain($url); echo $url.'<br />'; $url=array_reverse(explode('.',$url)); var_dump($url); echo '<br />'; foreach($www as $key=>$value) { if(in_array($value,$url)) { unset($url[array_search($value,$url)]); } } foreach($tld as $key=>$value) { if(in_array($value,$url)) { unset($url[array_search($value,$url)]); } } var_dump($url); echo '<br />'; $domain_only=$url[1]; echo $domain_only; exit(); ?> By the way roopurt18 that is a genius little script. Utilizes some of what I started and then accounts for any case by using perg_match().
  16. K make this line <?php $url=array_reverse(explode('.',$raw_url),TRUE); ?> Like this. <?php $url=array_reverse(explode('.',$raw_url)); ?> Now we need to take it further, now you need to do checks with in the array for each TLD and remove that from the array, also you need to check for each possibility of www eg www1 www2 etc. I will post back soon when I have taken this further.
  17. This is the thing about adding headers, you can add a header, but it may not be real. Which in your case it is not real it is really coming from the centeral mail server. So this is considered a spoof, one of two things may happen at that time. The sending mail server may provide it's on From header and overwrite the existing. Or recieving mail servers may delete this header from the email. Either way your email client is not getting spoofed. What you can do is put the user's name in the subject. That is what I do. Make it "User Whoever - Subject of my message". <?php subject=$_POST['name'].'- '.$subject; ?> As a final word please make sure that you are properly screening the incoming vars to protect yourself, your server, and clients if you have them.
  18. The way that the script is setup is the way that want it to work, make sure you are putting just a name in the name field and not inserting an email in the name field. To test you can echo $_POST['name'].' & '.$_POST['email'];
  19. Just remember it is not really from them. <?php $headers = 'From: '.$_POST['name']."\r\n". 'Reply-To: '. $_POST['email'] . "\r\n" . 'X-Mailer: PHP/' . phpversion(); ?> However this is extremly insecure code. You need to run htlmentities() on everything that is coming in from a form submitted by a outside user.
  20. The problem was, you did not actually call your function. <?php $url = 'http://site.com'; // Split link to just get domain name function parse_url_domain ($url) { $parsed = parse_url($url); $hostname = $parsed['host']; return $hostname; } $raw_url = parse_url_domain($url); $url=array_reverse(explode('.',$raw_url),TRUE); $domain_only=$url[1].$url[0]; echo $domain_only; exit(); ?>
  21. <?php $url = http://site.com; // Split link to just get domain name function parse_url_domain ($url) { $parsed = parse_url($url); $hostname = $parsed['host']; return $hostname; } $raw_url = parse_url($url); $url=array_reverse(explode('.',$raw_url),TRUE); $domain_only=$url[1].$url[0]; echo $domain_only; exit(); ?>
  22. In the foreach I think you meant that "$Addon" should be "$AddonName". <?php var_dump($Addon); /* array(2) { ["Hangman"]=> string(7) "Hangman" ["TicTakToe"]=> string(11) "Tic Tak Toe" } */ function GetAddonInfo($AddonName) { foreach ($AddonName as $Folder => $Name) { if ($AddonName == $Name) { echo "Addon Information:\n"; echo "Name: ".GetAddonINI($Folder."/Info.ini", "Name"); echo "Description: ".GetAddonINI($Folder."/Info.ini", "Description"); echo "Author: ".GetAddonINI($Folder."/Info.ini", "Author"); echo "Email: ".GetAddonINI($Folder."/Info.ini", "Email"); echo "Website: ".GetAddonINI($Folder."/Info.ini", "Website"); } else { echo "Cannot find the addon '$AddonName'."; } } } ?>
  23. This could get very complex very quickly. But if those are the only types of url then try this. <?php $url=array_reverse(explode('.',$url),TRUE); $url=$url[1].$url[0]; ?> Now if you need it to do more with more difficult url's let me know and I will take this further.
  24. I think that what you have will do just fine, you have ensured that the applet is only reading files with in the server, so you should be fine with out additional PHP so long as your CGI is good.
  25. Hmmm I am not sure how that logicly makes a difference, interesting. Well any ways, glad it is fixed.
×
×
  • 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.