Jump to content

koencalliauw

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Everything posted by koencalliauw

  1. [quote author=almightyegg link=topic=113778.msg462932#msg462932 date=1162664914] hmm...i found one that i thought could help...so i changed the file permissions to -rw-rw-rw- but it still shows: Warning: mkdir(/home/lordofth/public_html/images/players/21) [function.mkdir]: Permission denied in /home/lordofth/public_html/activate.php on line 27 [/quote] You should make sure that safe_mode in your php.ini is turned off if possible. Next you should check that the directory that you want to have write permissions in, has the permissions 775, the owner your user and the group should be the group that runs apache (type 'groups apache' to find out in a terminal). Also, when you are relying on a hosting provider, check with them if they haven't disabled some functions (like mkdir).
  2. I don't think this can be done, a while ago I tried something along those lines, but didn't find anything.
  3. [!--quoteo(post=369489:date=Apr 28 2006, 09:48 AM:name=apit)--][div class=\'quotetop\']QUOTE(apit @ Apr 28 2006, 09:48 AM) [snapback]369489[/snapback][/div][div class=\'quotemain\'][!--quotec--] browsing other website throught our php script...how to do this [/quote] You could try an html iframe and set the src tag for the iframe using php: [code] $site_to_browse = "http://www.google.com"; echo "<iframe src='" . $site_to_browse . "'></iframe"; [/code]
  4. what features do you want it to have? Koen.
  5. Could you give us the SQL query? also, could you check in the HTML source if the table gets ended correctly (</table>)? Koen
  6. You probably should do something to check if the result set for your query is correct (if there is no sql-error, that is): [code] $sql="select * from employees"; $res=@mysql_query($sql); if($res!=FALSE) {     echo mysql_num_rows($res); } else {     echo "There was an error in your SQL query: " . mysql_error() . "\n<br />The given SQL query was: " . $sql; }[/code]
  7. I can see you are getting the pid from the querystring, I can follow so far, but then you make a sql query, but you don't do anything with it. If I assume correctly, the empRef is a field in you database, so you would have to do the following: [code] if (isset($HTTP_GET_VARS['pid'])) {       $query ="SELECT * FROM airticketbooking where empRef='$HTTP_GET_VARS[pid]'";     $result = mysql_query ($query) or die (mysql_error());     $row = mysql_fetch_array($result);     echo "Employer RefID: " . $row["empRef"]; } [/code] or if you just wanted to display the pid that you have in the hyperlink, you could just do: [code] if (isset($_GET['pid'])) {       echo "Employer RefID: " . $_GET["pid"]; } [/code] Koen.
  8. try this: [code] <?php $arr = array('milk','eggs','bread'); foreach ($arr as $value) { $mailbody="$value\n\n"; mail("me@myself.com", "testing 123", "$mailbody", "From: Myself<me@myself.com>"); echo "<p>$value</p>"; } ?> [/code] .= means it appends a value to the previous value so the behaviour you had is normal. Probably your arguments for the foreach loop were correct, but this is simpler I think.
  9. I agree, but given the error mysql produces, it is however most probably this that produces the error, not to mention that it is horrible coding practice to not specify the fields (suppose you do this everywhere in your script and you need to add a field to your table, you would need to recode all your queries as this can only be used if the value count is the same as the total field count for the table)
  10. the correct syntax for the insert query is: insert into mytable(field1,field2) values(value1,value2); you forgot the (field1,field2) part. Koen
  11. You don't need php to do this, you need javascript/css 1. create a div that contains all your comments, give it an id or a class that you refer to in your css file <div id='comment'> comments go here </div> 2. in the css, set 'display: none;' for the div that contain comments 3. create a button on your page 4. add the onclick event (javascript) to the button <input type='button' value='show comments' onclick="document.getElementById('comment').style.display=block;"> this is all from the top of my head, I usually keep javascript language reference nearby. If you want to do some other things or just to keep things readable in your code, you could create a function that doest the same. <input type='button' value='show comments' onclick="showcomments()"> <script type='javascript'> var comment = document.getElementById('comment').style; comment.display = 'block'; </script> Warning: this will NOT create the slider effect, you need something like on [a href=\"http://script.aculo.us\" target=\"_blank\"]http://script.aculo.us[/a] for that, don't ask me questions about it, cos I just know it exists, never used it
  12. Hi, thanks for replying, I'll post the upload script here when it's done. Koen.
  13. anybody have any ideas on how to upload large files decently using (preferably) only php?
  14. if you do not want to write the code yourself, take a look at this: [a href=\"http://www.phpclasses.org/browse/package/2779.html\" target=\"_blank\"]http://www.phpclasses.org/browse/package/2779.html[/a]
  15. take a look at the vars: session.cookie_lifetime session.cache_expire in your php.ini, cookie_lifetime is 0 by default I think (session expires when user closes browser), cache_expire is less important but take a look at it anyway.
  16. When do you consider posts to be 'new'?
  17. the functions you execute are run in the shell by the user nobody, not through HTTP, which means your .htaccess files (password protection) are rendered useless for these kind of actions.
  18. try experimenting with the DISTINCT keyword in MySQL (select distinct client.id, ...) Koen
  19. for backing up your MySQL db, you should check out the console command for mysqldump (or mysql_dump, I forgot) in combination with the exec() function. for uploading bigger files, check the following in php.ini post_max_size = 8M; (set this to a higher number) file_uploads = On; (make sure this is 'On') upload_max_filesize = 8M (set this to a higher number) memory_limit = 10M (set this somewhat higher than post_max_size) max_execution_time (depending on the upload speed of client, you might want to set this to several minutes) in httpd.conf (or whatever your apache config file is) limitrequestbody = XXX (set this to your convenience) Koen.
  20. I have some functions for request variables and arrays, if that is what you mean, but probably not: [code] function p($var) {     //returns the POST variable you request     return $_POST[$var]; } function g($var) {     //returns the GET variable you request     return $_GET[$var]; } function pr($arr) {     //print the array in a readable format     echo "<pre>";     print_r($arr);     echo "</pre>"; } [/code]
  21. Exactly, I think that will be the problem, suppose googlebot hits your site, It'll not know what url to enter, just call the file without params, if that happens, no vars get set, so no $uniquedir gets set, ... boom. Check the dirs you want to delete, check that they are at least 1 or 2 chars long (use strlen or something), check if the directory exists and make sure you put in an extra check that it does not delete some unintended dir for some weird reason. Like this, this script was bound to have this kind of behaviour at some point. Koen
  22. suppose the script you're calling multiple times is: [a href=\"http://www.someserver.com/myscript.php\" target=\"_blank\"]http://www.someserver.com/myscript.php[/a] [code] $myscript = "http://www.someserver.com/myscript.php"; $ref = $_SERVER["HTTP_REFERER"]; if(eregi($myscript,$ref)) {     $firsttime = FALSE; } else {     $firsttime = TRUE; } [/code] another way: [code] if(eregi($_SERVER["PHP_SELF"],$_SERVER["HTTP_REFERER"])) {     $firsttime = FALSE; } else {     $firsttime = TRUE; } [/code]
  23. try experimenting with the filectime() function [a href=\"http://www.php.net/manual/en/function.filectime.php\" target=\"_blank\"]Function reference for filectime (php.net)[/a]
  24. just for future reference: you can check if $_SERVER["HTTP_REFERER"] is empty (only if the script is called directly), then it is the first time, otherwise, it is not. If the script is not called directly, check what $_SERVER["HTTP_REFERER"] is and compare it to what it returns each time you call the page.
  25. Hi, I'm not sure about cPanel, but with plesk the file resides under (your ftp root)/conf/vhost.conf). However, if this is a hosted environment there is no way that you will be able to write to the folder you set in above script as this seems like a vital folder on the server. You should just try adding a folder under your site root, set the permissions to 775 or 755, adjust your script to use a relative path: copy ("$file", "./my_upload_folder/".$file_name) and try again. koen
×
×
  • 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.