Jump to content

Stephen

Members
  • Posts

    200
  • Joined

  • Last visited

    Never

Everything posted by Stephen

  1. I like the design/layout of both the calendar and the slightly simpler admin panel. I can definitely see this being used on business sites (as long as there are no security exploits.)
  2. The word search solver is awesome - I suck at word searches, and one of my teachers actually grades them ;-;. Thanks. Ooh, rage.
  3. Not to mention you forgot the semicolon after: echo 'You are not meant to be here.'
  4. You need to use double quotes instead of single quotes for it to show the value of the variable. Or you could just do, ' . $home . ' etc. So, <?php function navigation($home, $resume, $port, $contact) { echo ' <ul> <li><a href="index/"><img src="images/' . $home . '.png" alt="Home Page" /></a></li> <li><a href="resume/"><img src="images/' . $resume . '.png" alt="Resume" /></a></li> <li><a href="portfolio/"><img src="images/' . $port . '.png" alt="Portfolio Pieces" /></a></li> <li><a href="contact/"><img src="images/' . $contact . '.png" alt="Contact" /></a></li> </ul> '; } ?> is one way.
  5. I am trying to parse something that looks like this: <style type="text/css">/*\*/@import url(http://www.site.com/css/global.css);/**/</style> <style type="text/css">/*\*/@import url(http://www.site.com/css/home.css);/**/</style> and retrieve just the URL contained in the parenthesis. However, every regex expression I've tried fails, such as /<style\s[^>]*>\/\*\\\*\/@import url\(\s[^>]*\);\/\*\*\/<\/style>/ Please note that I completely fail at regex and any expression that actually works will be appreciated
  6. Oh yeah, I just looked at your html source and the php in that cell actually outputs: <SCRIPT LANGUAGE="JavaScript"> function fn_HideElement( elementName ){ ele = document.getElementById( elementName ); if( ! ele ){ alert( 'cannot find ' + elementName ); return; } ele.style.display = "none"; } function fn_ShowElement( elementName ){ ele = document.getElementById( elementName ); if( ! ele ){ alert( 'cannot find ' + elementName ); return; } ele.style.display = "block"; } </SCRIPT> <STYLE> ul#phpFastNews { list-style-type: none; margin: 0.5em 0; padding: 0; } ul#phpFastNews li { list-style-type: none; margin: 1em 0; padding: 0; } </STYLE> <UL ID="phpFastNews"> <A ID="fn-loginBar" HREF="#" ONCLICK="fn_ShowElement('fn-loginForm'); fn_HideElement('fn-loginBar'); return false;">Login</A> <LI ID="fn-addForm" STYLE="display: none;"> <H3>Add News Item</H3> <FORM METHOD="post" ACTION="http://www.poshinteriors.com/09/news/fastnews-code.php"> <INPUT TYPE="hidden" NAME="fn_action" VALUE="add"> <INPUT TYPE="text" SIZE="48" NAME="subject" VALUE="News Subject"><BR> <TEXTAREA ROWS="6" COLS="48" NAME="message">News Text</TEXTAREA><BR> <INPUT TYPE="submit" VALUE="Add"> </FORM> </LI> <LI ID="fn-loginForm" STYLE="display: none;"> <H3>Login</H3> <FORM METHOD="post" ACTION="http://www.poshinteriors.com/09/news/fastnews-code.php"> <INPUT TYPE="hidden" NAME="fn_action" VALUE="login"> Password: <INPUT TYPE="password" SIZE="24" NAME="password" VALUE=""><BR> <INPUT TYPE="submit" VALUE="Login"> </FORM> </LI> <LI ID="fn-view-2"> <H3>Chads Test</H3> <I>15 Jun 2009 5:54 pm</I> <BR> my Test <BR> </LI> <LI ID="fn-edit-2" STYLE="display: none;"> <H3>Edit News Item</H3> <FORM METHOD="post" ACTION="http://www.poshinteriors.com/09/news/fastnews-code.php"> <INPUT TYPE="hidden" NAME="fn_action" VALUE="update"> <INPUT TYPE="hidden" NAME="id" VALUE="2"> <INPUT TYPE="text" SIZE="48" VALUE="Chads Test" NAME="subject"><BR> <TEXTAREA ROWS="6" COLS="48" NAME="message">my Test</TEXTAREA><BR> <INPUT TYPE="submit" VALUE="Update"><BR> </FORM> </LI><LI ID="fn-view-1"> <H3>Today's Hot News</H3> <I>2 Sep 2008 4:43 pm</I> <BR> Hello! It is a really nice weather today. It is only getting better with phpFastNews script! Get it up and running in minutes! <BR> </LI> <LI ID="fn-edit-1" STYLE="display: none;"> <H3>Edit News Item</H3> <FORM METHOD="post" ACTION="http://www.poshinteriors.com/09/news/fastnews-code.php"> <INPUT TYPE="hidden" NAME="fn_action" VALUE="update"> <INPUT TYPE="hidden" NAME="id" VALUE="1"> <INPUT TYPE="text" SIZE="48" VALUE="Today's Hot News" NAME="subject"><BR> <TEXTAREA ROWS="6" COLS="48" NAME="message">Hello! It is a really nice weather today. It is only getting better with phpFastNews script! Get it up and running in minutes!</TEXTAREA><BR> <INPUT TYPE="submit" VALUE="Update"><BR> </FORM> </LI> <DIV STYLE="font-size: 0.75em; margin: 1em 0 0 0;">Powered by <A HREF="http://www.phpfastnews.com">phpFastNews</A> - fast and free news display script</DIV> </UL> I'm not sure where the actual news is outputted from.
  7. I'm assuming: <?php include_once( dirname(__FILE__) . '/fastnews-code.php' ); $fn = new fastNews(); echo $fn->display(); ?> is the part that prints your news? If so, try using this: <?php include_once( dirname(__FILE__) . '/fastnews-code.php' ); $fn = new fastNews(); echo substr($fn->display(), 0, 250); ?> (note the substr)
  8. Ah, thanks. I didn't think of just skipping over the excess spaces D: However, there is one problem: if the file name contains a space in it, it starts a new row. I suppose this could be solved by doing file names separate.
  9. Besides the script being unsafe, make sure that the column name in the table is "password", the name of the input for the password is "pass", and they're encrypted the same way.
  10. $ars["shell"]["exec"] = `ls -aFhl --group-directories-first ./`; echo($ars["shell"]["exec"]); Outputs: total 80K drwxr-xr-x 4 stephen root 4.0K 2009-06-08 20:39 ./ drwxr-xr-x 20 stephen root 4.0K 2008-09-24 08:16 ../ drwxr-xr-x 2 stephen root 4.0K 2009-01-04 19:15 webalizer/ drwxr-xr-x 7 stephen root 4.0K 2009-01-04 19:15 xampp/ -rw-r--r-- 1 stephen stephen 105 2009-06-08 21:22 ars.php -rw-r--r-- 1 stephen root 31K 2007-05-11 08:40 favicon.ico -rw-rw-rw- 1 stephen root 163 2003-10-31 16:15 index.html -rw-r--r-- 1 stephen stephen 12K 2008-12-07 16:19 index.php -rw-r--r-- 1 stephen stephen 1.8K 2009-01-04 19:12 layout.html -rw-r--r-- 1 stephen stephen 7.7K 2008-12-07 16:06 rsc.php Is there anyway to arrange the output of the command into a table with separate columns, such as permissions, links, owner, group, size, last edited, and file name.
  11. Thanks. Basically, you just do the imagecreate commands twice and then do imagecopy.
  12. Let's say I'm making an image with 200 width and 30 height in PHP with the imagecreate function. Is it possible to insert a smaller image, say 16x16 (just an example), into the left hand corner (or any X and Y I instruct it to) of the image I created via PHP, or will I have to pre-create the image with that smaller image already on it and have to use imagecreatefrom<>?
  13. You can use file_put_contents with the data you received and the filename. http://us3.php.net/manual/en/function.file-put-contents.php (or any fwrite-type command)
  14. You can post to the site using cURL then show the information it shows after that. I've done things like that, but it's sort of a pain if you need cookies. I can't explain it too well right now. But yes, cURL can do it.
  15. Err like: echo date("F jS, Y - h:i:sA");
  16. What about something like: <?php echo "mp3 file is " . strlen(file_get_contents("http://ia310813.us.archive.org/2/items/ConnectionAndAlienation/20080221AVIRADHAMMO_32kb.mp3")) . "bytes"; ?>
  17. I think it should be ($weightA / 1000), n3ight.
  18. Just try doing header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . $name . '"'); readfile("$file"); It works for me in FF3.
  19. Yeah, it doesn't go in $_POST at all. POST["letters"] = 3 POST["submit"] = Upload FILES["file"] = Array FILES["file"]["name"] = ohio.jpg FILES["file"]["type"] = image/jpeg FILES["file"]["tmp_name"] = /tmp/php2Rq5Zw FILES["file"]["error"] = 0 FILES["file"]["size"] = 51711
  20. Well you can use cron jobs to keep running it every say week. The closest php script (instead of cron) to do it would probably look something like: <?php set_time_out(0); ignore_user_abort(true); $_vew["config"]["days"] = 0; $_vew["config"]["hours"] = 0; $_vew["config"]["minutes"] = 5; $_vew["config"]["seconds"] = 5; $_vew["time"]["total"] = $_vew["config"]["seconds"] + ($_vew["config"]["minutes"]*60) + (($_vew["config"]["hours"]*60)*60) + ((($_vew["config"]["days"]*24)*60)*60); do { //execute code to do every <x> time sleep($_vew["time"]["total"]); } while (true); ?> Haven't tested though.
  21. <?php if (empty($_POST["submit"])) { echo(" <form enctype=\"multipart/form-data\" action=\"\" method=\"POST\"> File: <input name=\"file\" type=\"file\" /><br /> Letters: <input name=\"letters\" type=\"text\" value=\"3\" /><br /> <input type=\"submit\" value=\"Upload\" name=\"submit\" /> </form> "); } else { set_time_limit(0); function vew_strlen_allow($str) { if (strlen($str) <= (intval(htmlentities($_POST["letters"], ENT_QUOTES))+1)) { return true; } else { return false; } } $_vew["file"]["data"] = file_get_contents($_FILES["file"]["tmp_name"]); $_vew["file"]["array"] = explode("\n", $_vew["file"]["data"]); $_vew["file"]["array_filter"] = array_filter($_vew["file"]["array"], "vew_strlen_allow"); header("Content-disposition: attachment; filename=" . $_FILES["file"]["name"]); header("Content-type: application/octet-stream"); echo(implode("\n", $_vew["file"]["array_filter"])); exit; } ?> New full code, and it's fixed. I got rid of that letters variable and put it directly into the function.
  22. set_time_limit(0); $_vew["config"]["letters"] = intval(htmlentities($_POST["letters"], ENT_QUOTES)); function vew_strlen_allow($str) { if (strlen($str) <= $_vew["config"]["letters"]) { return true; } else { return false; } } $_vew["file"]["data"] = file_get_contents($_FILES["file"]["tmp_name"]); echo($_vew["file"]["data"]); $_vew["file"]["array"] = explode("\n", $_vew["file"]["data"]); print_r($_vew["file"]["array"]); $_vew["file"]["array_filter"] = array_filter($_vew["file"]["array"], "vew_strlen_allow"); print_r($_vew["file"]["array_filter"]); echo(implode("\n", $_vew["file"]["array_filter"])); Everything echos/prints correctly up to print_r($_vew["file"]["array_filter"]); echo(implode("\n", $_vew["file"]["array_filter"])); It just returns blank. I don't know what's wrong with it. EDIT: By the way, it returned this: 1 22 333 4444 55555 666 6 777777Array ( [0] => 1 [1] => 22 [2] => 333 [3] => 4444 [4] => 55555 [5] => 666 [6] => 6 [7] => 777777 ) Array ( )
  23. What is $newwords (the first time) and $word2? Also what is $oldtext?
  24. Not sure what you mean by requirements. Like, the columns in the database? Simple ones would include userid, username, password, salt, email, join_date.
×
×
  • 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.