Jump to content

trillion

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Everything posted by trillion

  1. I am trying to display results from a MySql query using php sort of like this: result_row_0 | result_row_1 | result_row_3 result_row_4 | result_row_5 | result_row_6 ... et cetera ... this is to say that I have an undetermined # of rows of data and I wish to display the first three on one row of a table, the next three on a second table row and so on. Thanks for any help or ideas.
  2. The server is apache. The problem is that the playlist file is called from a flash .swf the .swf playlist access appears to the server as a regular direct playlist file access. Perhaps if I could allow only designated php files to access the playlist file. For example: I have a file player.php. This file holds the .swf player. If this file only was granted access to open readable the playlist file. I am not sure this will work either as it is actually the .swf that opens the playlist.php. Also the playlist.php output is an XML playlist doc if that has any effect as to securing the contents.
  3. I need to deny direct access to a php file. This file builds an xml formated output for an mp3 player that uses XSPF playlists. I have tried the methods mentioned here and these will come in handy for other areas but on this issue these techniques are not working. http://www.codingforums.com/showthread.php?p=496650 The file that calls the php playlist file is a Flash file. The flash file is calling the playlist so the linked examples above fail because the playlist is not getting the correct message. I have worked with php/flash inter-communication before but I did not build this mp3 player. This is the player: http://musicplayer.sourceforge.net/ So I need another way to keep the user from accessing the playlist file directly. Thanks
  4. then could a malicious file uploaded get access the same way?
  5. there are a number of ways to do this. One way is a redirect after mailform.php sends the mail and before it produces any output. redirect to next.php: header("Location: http://www.fertilizethoughts.com/next.php");
  6. One specific case: A form uploads an mp3 file say to a folder called music that is directly above public_html then a php page plays the mp3 like home/music/mp3 home/public_html/player.php how do I access the mp3 file. Do I set an absolute path as variable some place? I have tried with a basic html embed tag and file path as "../music/mp3" but this is not working. of course a URL will not work and I guess that is why the above path fails because it is a URL but how to access the mp3 with an absolute path for display?
  7. something like this maybe: [code]$var = $_POST[poem]."<br/>";[/code] then put  $var into the database insert query
  8. if you enter in the url test.php?category=test this code in test.php file: [code]<?php if ($category == "test") {     echo "<div id='test'>   TEST! </div>"; } ?>[/code] will return: TEST! but register globals has to be on
  9. what output are you looking for exactly? do you want this part: 01:00:03 AM to look like this: 00:00:03 UTC
  10. I have often read to place upload directories(any directory with chmod 0777) behind the www root(pulic_html in my case) I understand the reasoning and would like my server to be as secure as possible but I also want to access the files uploaded via php for display. Is there something I am missing here? It seems uploaded files/directories are concidered safe when behind public_html because they are not accessible. Is there a method to still access these files from a browser?
  11. I want to provide members with an email account. This account should be create via PHP. I have found this to do it if the server is using cpanel: http://www.zubrag.com/scripts/cpanel-create-email-account.php but my server uses vdeck. Has anyone seen something to automatically create email accounts like the above script but for vdeck administrated servers?
  12. This should be easy but I am stumped! How do I rename a directory? [code]<?php rename ('dirname1','dirname2'); ?>[/code] gets permissions denied and chmod is 0777
  13. How can I get my php script to complete even if the user closes their browser that initiated the script? I don't think I will have command line access but would like to know if that is is only option as I may have to switch hosts.
  14. OK There was a bug in the tutorial. here is the fix. change: [code]$mailer->Body($htmlBody);[/code] to: [code]$mailer->Body = $htmlBody;[/code] and change: [code]$mailer->AltBody($textBody);[/code] to: [code]$mailer->AltBody = $textBody;[/code] now it works
  15. I am trying the tutorial here: http://www.phpfreaks.com/tutorials/130/0.php to set up php email using phpmailer. It works fine for basic text email but when I get to the part to add html body content I get this error: Fatal error: Call to undefined function: body() in /home/user/public_html/dir/dir/mailto-html.php on line 21 the code looks like this: [code]require_once('../config.php'); require_once('MailClass.inc'); $mailer = new IDMailer(); $mailer->Subject = 'This is a Test'; $htmlBody = ' <html><head><title>HTML Tst Ml</title></head><body> <img src="http://phpfreaks.com/images/phpfreaks_logo.php" /><br /> <h2>PHP Rocks!</h2> <p>We text text text text text text text text text text text text <a href="http://inherentdesign.com>ID</a> text text text text text</p> '; $textBody = 'Hopefully I will not see this'; $mailer->Body($htmlBody); $mailer->isHTML(true); $mailer->AltBody($textBody);[/code] there is more under this but above is what seems relevant to the issue as I get the error at line [code]$mailer->Body($htmlBody);[/code] If I comment out the function body() I get a similar error for function altbody() what have I gotten wrong?
  16. Look: http://www.phpfreaks.com/phpmanual/page/faq.misc.html#faq.misc.registerglobals
  17. I have been trying to install gd library on my server I finally got it to work and all command line test were successful gd library still not work with php though php.ini gd line is incommented as per http://www.phpfreaks.com/tutorials/105/0.php I did [b]php -m[/b] on the command line and get: [b]PHP Warning: Unknown(): Unable to load dynamic library './php_gd2.dll' - (null) in Unknown on line 0[/b] How can I fix this and get gd library working with php?
  18. http://academ.hvcc.edu/~kantopet/old/php/index.php?page=php+variables&parent=php+basics
  19. I finally got the desired results with this: $lt = $_POST['tl']; if ($lt == 'rt') { $move_q1 = "UPDATE please SET status = '1' WHERE position = 'pos2'"; mysql_query($move_q1) or die('Query failed: ' . mysql_error()); $move_q2 = "UPDATE please SET position = 'pos2' WHERE position = 'pos1'"; mysql_query($move_q2) or die('Query failed: ' . mysql_error()); $move_q3 = "UPDATE please SET position = 'pos1' WHERE status = '1'"; mysql_query($move_q3) or die('Query failed: ' . mysql_error()); $move_q4 = "UPDATE please SET status = '0' WHERE position = 'pos1'"; mysql_query($move_q4) or die('Query failed: ' . mysql_error()); } this code seems pretty long to acheive the result of switching two values. If anyone could now help me shorten it I would be very grateful Thank you
  20. what do you get for a simple echo $_GET['id_eve'];
  21. I don't know how you are getting your text to the php but this example will change '/n' to ' ' in the input from a $_POST form submit $texttopass = str_replace("\n"," ",$_POST['textfromphp']); put a line like this after your input is recieved and before your text file is written to
  22. try this maybe $id = $_GET['id_eve']; $MM_redirectLoginSuccess = "calenderedit.php?id_eve=".$id;
  23. I couldn't get the example from sasa to work as I am dealing ideally with only one variable in each row that is effected the temp idea works great when i run it at the command line however there is something in my php that is making mysql show very strange results if i comment out the mysql query that updates the tables everything comes off clean and nothing is changed.  Just as it should be. however when I uncomment the update table queries and give the signal for the script to be run all this happens: 1) the browser hangs up. 2) when I go back to the command line and do a select * from classes; the class column, with pos1 and pos2 are unstable. I run the select all command say five times in a row, without doing anything else and the values are different on just about every select * execution. is this because of some lag effect. am I some how asking mysql to change these values a number of times each? I beleive this is the case. after I typed this far I went back and ran select * twice and the valuse were stable. So how am I asking for these values to be change that many times? here is my code again. $lt = $_POST['tl']; if ($lt == 'rt') { $move_q1 = "UPDATE classes SET class = 'temp' WHERE class = 'pos1'"; $move_r1 = mysql_query($move_q1) or die('Query failed: ' . mysql_error()); $move_q2 = "UPDATE classes SET class = 'pos1' WHERE class = 'pos2'"; $move_r2 = mysql_query($move_q2) or die('Query failed: ' . mysql_error()); $move_q3 = "UPDATE classes SET class = 'pos2' WHERE class = 'temp'"; $move_r3 = mysql_query($move_q3) or die('Query failed: ' . mysql_error()); }
  24. some values in one mysql are acting quite erratically and I am wondering if I have accidentally coded and infinite loop. Here is my code: $move_q1 = "UPDATE classes SET class = 'pos2' WHERE class = 'pos1'"; $move_r1 = mysql_query($move_q1) or die('Query failed: ' . mysql_error()); $move_q2 = "UPDATE classes SET class = 'pos1' WHERE class = 'pos2'"; $move_r2 = mysql_query($move_q2) or die('Query failed: ' . mysql_error()); will this cause mysql to continually switch these values or will it do it once and stop? What I want to happen is when an element using 'pos1' is changed by submit to use 'pos2' then the element using 'pos2' switches automatically to 'pos1' my code wasn't working so I went to the command line and did a select * command for my table. I got two columns with 'pos1' out of curiosity I did again select * the two columns that were 'pos1' are now 'pos2' more select * commands showed that these values were unstable - they kept on switching What is going on? How can I get the results I want? here is my table structure I will gladly change it if need be +--------+-------------+------+-----+---------+-------+ | Field    | Type        | Null  | Key | Default | Extra | +--------+-------------+------+-----+---------+-------+ | class  | varchar(20) | YES  |      | NULL  |          | | src      | varchar(20) | YES  |      | NULL  |        | | height  | varchar(20) | YES  |      | NULL  |        | | width  | varchar(20) | YES  |      | NULL  |        | | op      | varchar(2)  | YES  |      | NULL    |        | +--------+-------------+------+-----+---------+-------+ well thaat came out badly, but whatever there it is
  25. I need to istall GD Library on a Mac running 10.4.6, Apache 1.3, and PHP 4.4.1. I have downloaded gd-2.0.33 and tried to confiure and make by following: 1) the included instructions 2) when that didn't work another instruction found online The second time I was told to download jpgsrc.v6b.tar I got jpgsrc to configure and make correctly! but still gd had errors I don't understand. Perhaps this is not even the right place to ask about this, so if anyone knows another forum, has any advice, or has successfully installed GD Library on a similar config please post. Also if you need any more info I will gladly run through the UNIX comand line process again to try to find more about the errors encountered. Thank you
×
×
  • 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.