Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. Erm.. if they goto http://example.com/ it will load http://example.com/index.php, if your not getting the 'HTTP_REFERER' its highly likely the browser isn't sending it.. if you mean you have a page that redirects to another you could do this:~ <?php $Ref = $_SERVER['HTTP_REFERER']; $URL = "http://mysite.com"; header("Referer: $Ref"); header("Location: $URL"); ?>
  2. using ToonMariner code <?php $qry = "SELECT `tags` FROM `your_table`"; $qry = mysl_query($qry); if (mysql_num_rows($qry) > 0) { $vars = array(); $i=1; while($row = mysql_fetch_assoc($qry)) { $vars["var$i"] = $row['tags']; $i++; } //debug echo "heres the array<br><pre>"; print_r($vars); //create variables extract($vars); echo "$var1 <br>"; echo "$var2 <br>"; echo "$var3 <br>"; echo "$var4 <br>"; //etc ?>
  3. some service providers will allow you to install PC's into their sevice rack, you could do that and then Install something like cPanel and have remote access, or lease a dedicated server from them, and use remote access to set it up.
  4. you can use the list() function but whats wrong with using an array? or even setting them $var1 = $row['car']; etc
  5. comment out both the headers and check, if it work uncomment one and test if it works its the other one.. goto the file that the bad header points to, check it doesn't refer to that file (you may need to check the included in that file as well)
  6. fopen opens the License/Key/Serial number file.. the file that opens it is normally protected.. so others can't see the validation checks
  7. have you tried it ? you could also look here Note its the WHERE `id`= '$id' AND `page`='$page'
  8. have you tried clearing the cache.. also whats the code for editprofile.php ? the firefox error normally points to a redirect pointing to itself
  9. Erm.. well a cron is run from the server and a sleep would be via a user script.. it all depends on when you want it to run! and what is for!
  10. Nope, if you post something thats blank it still posted from the code i you have posted i think i was wrong the bug thier but you can add a workaround function escape($value) { if(empty($value)) return ""; // NOTE: 0 with return "" but then again so will array() // strip slashes if(get_magic_quotes_gpc()) { //....snip
  11. So you want 1. to select a department. 2. to elect members from department (see 1) 3. Delete selected members try this <form action="index2.php?page=dptmbrdel3" method="post"> <?php require('../inc/config.php'); $linkid = @mysql_connect("$db_host", "$db_uname", "$db_pass"); mysql_select_db("$db_name", $linkid); $dptid=$_POST['id']; ?> <input name="dptid" type="hidden" value="<?PHP echo $dptid; ?>"> <?PHP $result = mysql_query("SELECT id, mbr_name FROM mbr WHERE ID in (SELECT dptm_userid FROM departments_mbr where dptm_dptid='$dptid')"); echo "<select name='mbrid' size='1'>"; while($row = mysql_fetch_array($result)) { echo "Update: <option name='" . $row["id"] . "' value='" . $row["id"] . "'>" . $row["mbr_name"] . "</option>"; } echo "</select>"; }
  12. function post2db($name, $type, $number) { global $form;//add here // communicate with CC gateway here $user = "root";
  13. okay i read this a few times.. and i'm still confused what your asking to do! it sounds like you want to do a join but without more infomation about the database its hard to say!
  14. if you connecting to a FTP sever on a MAC or PC you can use the standard FTP protocal its not the only way to connect to them, the xserve will probably have OSX installed this will have samba installed this allow PC users to connect to the fileserver so you can have you PHP connect via that as for connecting to via FTP i would suggest checking the PC & Mac servers FTP setup by installing a client and connecting to them and uploading a file or two, once your sure the servers FTP setup is correct then create a simple FTP script in PHP <?php $ftp_server = "xxx.xxx.xxx.xxx"; $ftp_user_name = "user"; $ftp_user_pass = "pass"; $destination_file = "file.txt"; $source_file = "file.txt"; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; exit; } else { echo "Connected to $ftp_server, for user $ftp_user_name"; } // upload the file $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); // check upload status if (!$upload) { echo "FTP upload has failed!"; } else { echo "Uploaded $source_file to $ftp_server as $destination_file"; } // close the FTP stream ftp_close($conn_id); ?>
  15. $result = mysql_query("SELECT id, mbr_name FROM mbr WHERE id = $dptid");
  16. Nope thats correct.. well kinda for the total you are no longer just in minutes so we need to add hours $time = date("i:s",$time); echo "<P>Total playlist: $i songs totaling: $time (minutes:seconds)</P>"; ?> to $time = date("H:i:s",$time); //Add hours echo "<P>Total playlist: $i songs totaling: $time (hours:minutes:seconds)</P>"; ?> OR $time = round($time/60); //convert to minutes echo "<P>Total playlist: $i songs totaling: $time minutes</P>";
  17. are you asking for FTP over SSH is sometimes referred to as secure FTP or securing FTP, such as with SSL/TLS (FTPS). *UNTESTED <?php $ftp_server = "xxx.xxx.xxx.xxx"; $ftp_port = 21; $ftp_timout = 90; $ftp_user_name = "root"; $ftp_user_pass = "secureFTP"; $remote_file = "helloworld.txt"; $file = "helloworld.txt"; // set up basic ssl connection $conn_id = ftp_ssl_connect($ftp_server, $ftp_port, $ftp_timout); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); //Returns the current directory name echo ftp_pwd($conn_id); // upload a $file to $remote_file (includeing the name) if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { echo "successfully uploaded $file\n"; } else { echo "There was a problem while uploading $file\n"; } // close the ssl connection ftp_close($conn_id); ?>
  18. sounds like a problem with your escape() function
  19. <?php //if its set then its check $pinned = (isset($_POST['pinned'])); $locked = (isset($_POST['locked'])); if($pinned) echo "pinned checked"; if($locked) echo "lockedchecked"; //debuger echo "debuger<br><pre>"; print_r($_POST); ?>
  20. the order of the fields doesn't matter.. infact you could, do $query="UPDATE $table SET Minutes='$sec' WHERE ID = $ID"; but if it messed up your need to restore your table from a backup.. thats why i said use seconds (just incase), also running it twice would probably mess it up using the SQL statement above
  21. $form['name'] etc isn't set or pull into the function post2db maybe add global $form; to the start of the function
  22. Yeah know that feeling... worst still is when they reply without any detail like.. PS Method B very cool, i would normally use Method A
  23. slight typo on Barand post %res should be $res
  24. try changinh $upload_dir = dirname(__FILE__)."/../../uploads/"; to $upload_dir = "/../../uploads/"; and move_uploaded_file($this->_params['tmp_name'], $this->_upload_dir.$this->new_name); $this->imgurl = 'http://'.$_SERVER['HTTP_HOST'].preg_replace('/\/([^\/]+?)$/', '/', $_SERVER['PHP_SELF']).$this->_upload_dir.'/'.$this->new_name; to move_uploaded_file($this->_params['tmp_name'], dirname(__FILE__).$this->_upload_dir.$this->new_name); $this->imgurl = 'http://'.$_SERVER['HTTP_HOST'].preg_replace('/\/([^\/]+?)$/', '/', $_SERVER['PHP_SELF']).$this->_upload_dir.'/'.$this->new_name;
  25. erm.. how could the link include the URL ? anyways the last one should of worked.. did you get the same error ?
×
×
  • 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.