Jump to content

Andy-H

Members
  • Posts

    2,000
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Andy-H

  1. Andy-H

    Frames???

    thanks, didnt know about the body thing in noframes
  2. Andy-H

    Frames???

    I am making a hosting site for my friend and I was wondering weater to use frames as alot of people say not to use them but I don't know why. Any advice?
  3. http://commabunny.org/ In the username / password section I simply put ' (an apostrophi) clicked login (no pass) and: User stuff Logged in as ' Change Profile View Posts Log out if (ereg("[^A-Za-z0-9]", $_POST['uservar'])){ blah... } else { blah... }
  4. You could do with a PHP image verification script running on the register to stop bots spamming you with accounts. Add a scriptcheck to avoid floods etc... script.php <?php session_start(); $num = "0123456789"; $rand = substr(str_shuffle($num), 0, 4); $_SESSION['image_random_value'] = md5($rand); $image = imagecreatefromjpeg("images/imgbackground.jpg"); $textColor = imagecolorallocate ($image, 0, 0, 0); imagestring ($image, 5, 5, 8, $rand, $textColor); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header('Content-type: image/jpeg'); imagejpeg($image); imagedestroy($image); ?> scriptcheck.php <?php session_start(); require("dbconnectionfile.php"); $que = mysql_query("SELECT * FROM `???` WHERE `???` = '???' LIMIT 1")or die(mysql_error()); $arr = mysql_fetch_array($que); $scripttime = $arr['scripttime']; if ($scripttime <= time()){ $submit = strip_tags(mysql_real_escape_string($_POST['submit'])); $number = strip_tags(mysql_real_escape_string($_POST['number'])); $newtime = time() + rand(600,900); if ($submit){ if (md5($number) != $_SESSION['image_random_value']){ echo "Incorrect script number."; }elseif (md5($number) == $_SESSION['image_random_value']){ mysql_query("UPDATE `players` SET `scripttime` = '$newtime' WHERE `playername` = '$player' LIMIT 1")or die(mysql_error()); print ("<meta http-equiv=\"refresh\" content=\"0\">"); } } ?> <html> <head> <link rel="stylesheet" type="text/css" href="???" /> <title>.::::.</title> </head> <body> <form action="" method="post"> <table width="30%" align="center" class="tbl"> <tr><td align="center" class="*">Scriptcheck</td></tr> <tr><td align="center" class="*"><img src="script.php" /></td></tr> <tr><td align="center" class="*"> <input type="text" name="number" class="submit" size="5" maxlength="5" /> </td></tr> <tr><td align="center" class="tbl"> <input type="submit" name="submit" value="Submit" class="*" /> </td></tr> </table> </form> </body> </html> <? exit; } ?> Use: <?php session_start(); require("dbconnectionfile.php"); $submit = strip_tags(mysql_real_escape_string($_POST['submit']))' $script = intval($_POST['script']); if ($submit){ if (md5($script) != $_SESSION['image_random_value']){ echo "Script number incorrect."; }elseif (md5($script) == $_SESSION['image_random_value']){ code... }} ?> <html> <head> <link rel="stylesheet" type="text/css" href="???" /> <title>.::::.</title> </head> <body> <tablecrap> <tr> <td align="left" class="???" width="30%"> <img src="script.php" /> </td> <td align="left" class="???"> <input type="text" name="script" class="***" size="5" maxlength="4" /> </td> </tr> </tablecrap> </body> </html> It would also be useful to adjust the website according to screen resolution using javascript.
  5. if (!empty($_POST)){ array_map("strip_tags", "$_POST"); array_map("addslashes", "$_POST"); array_map("mysql_real_escape_string", "$_POST"); } if (!empty($_GET)){ array_map("strip_tags", "$_GET"); array_map("addslashes", "$_GET"); array_map("mysql_real_escape_string", "$_GET"); }
  6. Why dont you just change the achievements to a ratio of 20:1?
  7. TBH I had a users online pahe that refreshed every 60 seconds and no-one complained, as soon as my site went down however, I recieved about 100 msn messages complaining. The way I see it, if you can't decide between two website features,BETA test them and compromise on the least popular.
  8. TY I actually wasn't planning on making money from it lol. Lets face it, whose gonna compete with youtube; just thaught I'd test it.
  9. Lol, by the sounds of it you could do any job when your older, my dad drinks 1 700cl bottle of whisky a day (since cutting down from 2) and his doctor said he would be dead in 5 years (10 years ago) so how I follow by example and enjoy what I remember of lil while it lasts.
  10. You have the folders chmoded to 0777, yes?
  11. TY I do that anyway, didn't know why tho TBH; was just what I copied from codes. BTW what is cirrhosis? Like Multiple cirrhosis???
  12. Also, They use $_REQUEST (you really shouldn't) AND they don't even properly use strings on their array keys. =/ Any chance of an explanation of tese two statements???
  13. BTW DarkWater TY for making me look like a T**T lol I am self taught and when I say 3 years I mean spending most of my time wagging school to smoke sputnit and getting pissed most nights, in other words, about 6 months actually learning programming (practical not theory) learning from reading, copying, then writing the worst (mafia game) codes ever. P.S. Any writing mistakes are due to the fact I am pissed and stonned now...
  14. You have to give input for each function variable.
  15. Well I simply filled in the first form, submited it, filles in the second form (including the upload part with a flv format file, then submitted page two; it then skipped back to page1 of upload.tpl with no PHP error messages and no page errors... http://itchy.cirtexhosting.com/~nymorcom/index.php login: admin Pass: admin click upload... TY for any help
  16. Basically I have purchased FFMpeg hosting for a youtube clone site I wanted to test and the upload.php script wont work, this is a 3rd partys script (I had sent to me) which is advanced PHP which I do not understand as I am self taught (3 years experience). Here are the upload.php and upload.tpl scripts: <?php include("include/config.php"); session_start(); include("include/function.php"); chk_member_login(); isMailVerified(); if($config['enable_package']=="yes") { check_subscriber(100); } if($_REQUEST[action_upload]!="") { if($_REQUEST[field_myvideo_title]==""){ $err="Upload: Please Provide a video title."; } elseif($_REQUEST[field_myvideo_descr]==""){ $err="Upload: Please Provide a video description."; } elseif($_REQUEST[field_myvideo_keywords]==""){ $err="Upload: Please provide tag/s."; } elseif(count($_REQUEST[chlist])<1 || count($_REQUEST[chlist])>3){ $err="Upload: Please check (1 to 3) channel/s."; } if($err==""){ $page = "second"; STemplate::assign('secondpage',"second"); $listch=implode("|",$_REQUEST[chlist]); STemplate::assign('listch',$listch); $var = "<script language=javascript> var field_myvideo_title = $_REQUEST[field_myvideo_title]; var field_myvideo_descr = $_REQUEST[field_myvideo_descr]; var field_myvideo_keywords = $_REQUEST[field_myvideo_keywords]; var listch = $listch; </script>"; STemplate::assign("var", $var); } } if($_POST[upload_final]!="") { if($_FILES['field_uploadfile']['tmp_name']=="") $err="Please provide the video location."; if($err=="" && $_FILES['field_uploadfile']['tmp_name']!="") { $p=$_FILES['field_uploadfile']['name']; $pos=strrpos($p,"."); $ph=strtolower(substr($p,$pos+1,strlen($p)-$pos)); /* Space in Megabytes (MB) */ $space = round($_FILES['field_uploadfile']['size']/(1024*1024)); if($config['enable_package']=="yes") { check_subscriber($space); } if(($ph!="mpg" && $ph!="avi" && $ph!="mpeg" && $ph!="wmv" && $ph!="rm" && $ph!="dat") || $space>$config[max_video_size]) $err="Invalid Video Format."; } if($err=="") { $sql="insert into video set UID=$_SESSION[uID], title='$_REQUEST[field_myvideo_title]', description='$_REQUEST[field_myvideo_descr]', keyword='$_REQUEST[field_myvideo_keywords]', channel='0|$_REQUEST[listch]|0', space = '$_REQUEST[space]', addtime='".time()."', adddate='".date("Y-m-d")."', vkey='".mt_rand()."', type='$_REQUEST[field_privacy]', filehome='$_REQUEST[p]'"; $conn->execute($sql); $vid=mysql_insert_id(); $vdoname=$vid.".".$ph; if(isset($_FILES['field_uploadfile']['tmp_name']) && is_uploaded_file($_FILES['field_uploadfile']['tmp_name'])) { $ff = $config[vdodir]."/".$vdoname; if(move_uploaded_file($_FILES['field_uploadfile']['tmp_name'], $ff)) { $mov = new ffmpeg_movie($ff); video_to_frame($ff,$vid,&$mov,$listch[0]); $duration=$mov->getDuration(); exec("$config[ffmpeg] -i $config[vdodir]/$vdoname -acodec mp3 -ar 22050 -ab 32 -f flv $config[flvdodir]/".$vid.".flv"); } } //END $key=substr(md5($vid),11,20); $sql="update video set vdoname='$vdoname', flvdoname='".$vid.".flv', duration='$duration', vkey='$key' WHERE VID=$vid"; $conn->execute($sql); if($config['enable_package']=="yes") { $sql = "update subscriber set used_space=used_space+$space, used_bw=used_bw+$space, total_video=total_video+1 where UID=$_SESSION[uID]"; $conn->execute($sql); } header("Location:$config[baseurl]/upload_success.php?viewkey=$key&upload=yes&vid=$vid"); } } STemplate::assign('err',$err); STemplate::assign('msg',$msg); STemplate::assign('head_bottom',"blank.tpl"); STemplate::display('head1.tpl'); STemplate::display('err_msg.tpl'); STemplate::display('upload.tpl'); STemplate::display('footer.tpl'); ?> {if $secondpage ne "second" and $smarty.request.upload_final eq ""} <table> <tr> <td height="24" valign=top align=center><table width="760" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="5" height="24" background="images/nv_2_l.jpg" valign=top><img src="images/nv_2_l.jpg" width="5" height="24" alt=""></td> <th background="images/nv_2_bg.jpg" align=left width=760><span class="white_bold" valign=top align=left>Video Upload (Step 1 of 2)</span></th> <td width="5" background="images/nv_2_r.jpg"><img src="images/nv_2_r.jpg" width="5" height="24" alt=""></td> </tr> </table></td> </tr></table> <FORM id=theForm name=theForm action="{$baseurl}/upload.php" method=post encType=multipart/form-data> <TABLE cellSpacing=0 cellPadding=5 width="100%" border=0><TBODY> <TR> <TD align=right width=200><SPAN class=label><NOBR>Title:</NOBR></SPAN></TD> <TD><INPUT maxLength=60 size=40 name="field_myvideo_title" value="{$smarty.request.field_myvideo_title}"></TD> </TR> <TR> <TD vAlign=top align=right><SPAN class=label><NOBR>Description:</NOBR> </SPAN></TD> <TD><TEXTAREA name="field_myvideo_descr" rows=4 cols=50>{$smarty.request.field_myvideo_descr}</TEXTAREA></TD> </TR> <TR vAlign=top> <TD align=right><SPAN class=label><NOBR>Tags:</NOBR> </SPAN></TD> <TD><INPUT maxLength=120 size=40 name="field_myvideo_keywords" value="{$smarty.request.field_myvideo_keywords}"> <DIV class=formFieldInfo><STRONG>Enter one or more tags, separated by spaces.</STRONG> <BR>Tags are simply keywords used to describe your video so they are easily searched and organized. For example, if you have a surfing video, you might tag it: surfing beach waves.<BR></DIV></TD> </TR> <TR vAlign=top> <TD align=right><SPAN class=label><NOBR>Video Channels:</NOBR></SPAN></TD> <TD> <TABLE><TBODY><TR><TD vAlign=top> {insert name=list_channel assign=chinfo vid=$VID} {section name=i loop=$chinfo} <INPUT type=checkbox name=chlist[] value={$chinfo[i].id}>{$chinfo[i].ch}<BR> {/section} </TD></TR></TBODY></TABLE> <DIV class=formFieldInfo><STRONG>Select between one to three channels that best describe your video.</STRONG><BR>It helps to use relevant channels so that others can find your video!</DIV> </TD> </TR> <TR> <TD align=right> </TD> <TD><INPUT type=submit value="Continue ->" name=action_upload></TD></TR> </TBODY></TABLE> </FORM> {else} <table> <tr> <td height="24" valign=top align=center><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="5" height="24" background="images/nv_2_l.jpg" valign=top><img src="images/nv_2_l.jpg" width="5" height="24" alt=""></td> <th background="images/nv_2_bg.jpg" align=left width=760><span class="white_bold" valign=top align=left>Video Upload (Step 2 of 2)</span></th> <td width="5" background="images/nv_2_r.jpg"><img src="images/nv_2_r.jpg" width="5" height="24" alt=""></td> </tr> </table></td> </tr></table> <FORM id=theForm name=theForm action="{$baseurl}/upload.php" method=post encType=multipart/form-data> <table width="100%" cellpadding="5" cellspacing="0" border="0"> <tr valign="top"> <td width="200" align="right"><span class="label">File:</span></td> <td><div class="formHighlight"><input type="hidden" name="MAX_FILE_SIZE" value="104857600"> <input type="file" name="field_uploadfile" size="30"> <div class="formHighlightText"><strong>Max file size: 100 MB. No copyrighted or obscene material.</strong> <br>After uploading, you can edit or remove this video at anytime under the "My Videos" link on the top of the page.</div></div></td> </tr> <tr> <td align="right"><span class="label">Broadcast:</span></td> <td> <table cellpadding="1" cellspacing="0" border="0"> <tr> <td><input name="field_privacy" type="radio" value="public" checked></td> <td><span class="bold">Public:</span> Share your video with the world! (Recommended)</td> </tr> </table> </td> </tr> <tr> <td align="right"><span class="label"> </span></td> <td> <table cellpadding="1" cellspacing="0" border="0"> <tr> <td><input name="field_privacy" type="radio" value="private"></td> <td><span class="bold">Private:</span> Only viewable by you and those you share the video with.</td> </tr> </table> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td align="right"> </td> <td> <span class="bold">PLEASE BE PATIENT, THIS MAY TAKE SEVERAL MINUTES. <br>ONCE COMPLETED, YOU WILL SEE A CONFIRMATION MESSAGE.<br><br></span> <input type="hidden" name="field_myvideo_keywords" value="{$smarty.request.field_myvideo_keywords}"> <input type="hidden" name="field_myvideo_title" value="{$smarty.request.field_myvideo_title}"> <input type="hidden" name="field_myvideo_descr" value="{$smarty.request.field_myvideo_descr}"> <input type="hidden" name="listch" value="{$listch}"> <input name="upload_final" type="submit" value="Upload Video" ><!-- onclick='this.disabled = true;' --> <span id="hide_stuff" style="display:none;" class="bold"> <table><tr> <td valign=middle> <img src="{$imgurl}/LoadingGraphic.gif"></img></td><td valign=middle><font size=4>Uploading..</font></td> </tr></table> </span> </td></tr></table> </FORM> {/if} Any help appreciated TY
  17. Lol also in proper practice you should use selected="selected" or in this case checked="checked"
  18. Add a set style in your stylesheet for pre tags like: pre { code }
  19. That should work, if it isnt working add or die(mysql_error()); at the end and paste the error here. mysql_query("DELETE FROM Shows_Categories WHERE shows_id='".$data['shows_id']."'")or die(mysql_error()); Like that
  20. I used to have a text based mafia site with a messaging system, it worked fine for me in a text field like this: <tr><td align="center" class="sub" colspan="2">Message</td></tr> <tr><td align="center" class="tbl" colspan="2"> <textarea name="msg" class="submit" cols="35" rows="5"> <?php if ($rep){ print (" [b]On: ".$on." ".$from." Wrote:[/b] ".$mssg.""); } ?> </textarea> </tr></tr> That was for sending/replying to a message. <?php $tit = $_GET['read']; if ($tit == $id){ ?> <tr> <td align="center" class="tbl" colspan="8"><? print replace($msg); ?></td> </tr> <?php mysql_query("UPDATE `inbox` SET `read` = '1' WHERE `playername` = '$player' AND `id` = '$tit' LIMIT 1")or die(mysql_error()); } }} ?> That was where I displayed the message, the formatting worked fine for me like that.
  21. Can you show the code where the info is outputted please?
  22. I am not too good with this kind of stuff but I think people in the AJAX or Javascript topic will be able to help you as I think you would need to use the onChange function
  23. The only other thing I can think of is: if (!$_FILES['uploadedfile']){
  24. Have you tried if (!isset($files['uploadfile'])){ or if ($files['uploadfile'] == ""){ ???
  25. I am not very good at PHP but the obvious way it would seem to me is: $date = date('d/F/Y'); $time = date('h:i:s'); $row_date = $row['Date']; $day = explode("/", $date); $row_day = explode("/", $row_date); $time_disp = explode(" ", $row_date); if ($row_day[0] == $day[0]){ $echo = "Today - ".$time_disp[1]; }elseif ($row_day[0] == ($day[0] - 1) ){ $echo = "Yesterday - ".$time_disp[1]; }else{ $echo = $row_date; } THen add the display accordingly... Duno if it will work, as I said I'm not the best with PHP.
×
×
  • 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.