Guest davidbugeja Posted May 7, 2010 Share Posted May 7, 2010 Just today (and I did not edit any code whatsoever) if I type a link that starts with http:/ as a question or as an answer I get Page Cannot Be Displayed error. What might be the cause? If it type: gttp:// htttp:// httt:// All are accepted except http:/ . Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/200996-please-help-me-urgent-matter/ Share on other sites More sharing options...
trq Posted May 7, 2010 Share Posted May 7, 2010 Were going to need allot more information and maybe some relevant code. I have removed your link because we don't need it, and it smells of spam. Quote Link to comment https://forums.phpfreaks.com/topic/200996-please-help-me-urgent-matter/#findComment-1054525 Share on other sites More sharing options...
Guest davidbugeja Posted May 7, 2010 Share Posted May 7, 2010 Hi thank you for your reply. No it is not SPAM. What information should i provide? Another funny thing is that if i type http:// in a textfield it will let me post but not if I type http:// in a textarea. Quote Link to comment https://forums.phpfreaks.com/topic/200996-please-help-me-urgent-matter/#findComment-1054526 Share on other sites More sharing options...
trq Posted May 7, 2010 Share Posted May 7, 2010 What information should i provide? Relevant code. Quote Link to comment https://forums.phpfreaks.com/topic/200996-please-help-me-urgent-matter/#findComment-1054528 Share on other sites More sharing options...
Guest davidbugeja Posted May 7, 2010 Share Posted May 7, 2010 Here is the code for the Post Question Page. It will not work if I post an http:/ in Additional Details Text Area: <?php session_start(); if($_SESSION['Username'] == '' && !isset($_SESSION['Username'])) { header("location:login.php"); } require_once("includes/configuration.php"); require_once('includes/classes/class.inputfilter.php'); require_once('includes/functions.php'); require_once("includes/classes/class.database.php"); require_once("includes/classes/class.category.php"); require_once("includes/classes/class.question.php"); require_once("includes/classes/class.filter.php"); require_once('includes/captcha/recaptchalib.php'); $publickey = '6LeH9QcAAAAAAMk-nGsju2zL3131jcbvRkTIkU8I'; $privatekey = '6LeH9QcAAAAAACZvLUlE4AAgo8On2Dfbf2CcCy_8'; # the response from reCAPTCHA $resp = null; # the error code from reCAPTCHA, if any $error = null; $objCategory = new category(); $objQuestion = new question(); $objFilter = new filter(); if ($_POST['cmdAdd']) { $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], getParameter($_POST, "recaptcha_challenge_field", ''), getParameter($_POST, "recaptcha_response_field", '')); if ($resp->is_valid) { $rsFilter = $objFilter->GetList(array(array('filterid','!=','')),'',true); $wordFound=false; for ($i=0;$i<sizeof($rsFilter);$i++) { if (strpos(strtolower($_POST['question']), strtolower($rsFilter[$i]->word))!==FALSE || strpos(strtolower($_POST['title']), strtolower($rsFilter[$i]->word))!==FALSE) { $wordFound=true; break; } } if(getParameter($_POST, "question", '')==""){ $_POST["question"] =" "; } if (!$wordFound) { $objQuestion->questionId = ''; $objQuestion->langid = '1'; $objQuestion->question_text = $_POST['question']; $objQuestion->userid = $_SESSION['userid']; $objQuestion->categoryid = $_POST['level']; $objQuestion->date1 = date("d/m/Y",time()); $objQuestion->status ='Active'; $objQuestion->abuse = 'No'; $objQuestion->title = $_POST['title']; $id = $objQuestion->Save(); ////////////////////////////////////////////////// $myFile = "Watcher.txt"; $fh = fopen($myFile, 'a'); $ip = $_SERVER['REMOTE_ADDR']; $date = date ("l dS \of F Y h:i:s A"); // required escape backslash $id = $_SESSION['userid']; $myFile = "Watcher.txt"; $fh = fopen($myFile, 'a'); $stringData = "Question Posted By User: $id | IP Address: $ip | Date: $date \n\n"; fwrite($fh, $stringData); fclose($fh); ////////////////////////////////////////////////// echo "<script>location.href='confirmation.php'</script>"; exit(); } else { $msg = 'You question contains vulgar language. Please be respectful.'; } } else { $error = $resp->error; $msg = 'Incorrect Captcha Words. Please Try Again.'; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Saqsi.com - Ask A New Question</title> <meta name="Title" content="Saqsi.com - Ask A New Question" /> <meta name="description" content="Any sort of question is allowed on Saqsi.com, except those that violate our community guidelines." /> <?php include("includes/toptitle.php");?> <script> var newwindow; function poptastic(url) { newwindow=window.open(url,'name','height=450,width=480'); if (window.focus) {newwindow.focus()} } </script> <?php include("includes/search.php");?> <div class=home id=y-body-green-knowledge-search> <div id=content> <?php include("includes/left.php");?> <div id=middle> <DIV id=ks-homepage-heading>Ask A New Question</DIV> <DIV class=silk_hp_open id=ks-homepage-questions> <form name="frmQuestion" id="frmQuestion" method="post" action=""> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <tr> <td align="center" height="13px"><p><b><?=$msg?></b></p></td> </tr> <tr> <td><table width="100%" cellpadding="2" cellspacing="2" border="0"> <input type="hidden" id="questionid" name="questionid" value="<?php echo getParameter($_POST, "questionid", '')?>" /> <tr> <td align="right"><p><b>Your Question:</b></p></td> <td align="left"><input style="font-weight:bold;width:355px;" type="text" maxlength="200" value="<?=getParameter($_POST, "title", '')?>" name="title" onkeyup="updateButton()"></td> </tr> <tr> <td align="right"><b><p>Quick Hint:</b></p></td> <td align="left"><p>Please write your question in full. Properly formatted questions will get you more answers. <b>Correct:</b> Where can I buy designer clothes? <b>Incorrect:</b> Designer clothes.</p><td> </tr> <tr> <td align="right"><p>Question Category:</p></td> <td align="left"><select name="level" style="width:357px;" onchange="updateButton()"> <option value="">Please Select A Suitable Category For Your Question</option> <?php for($i=0;$i<sizeof($rsCategory);$i++) { ?> <option value="<?php echo $rsCategory[$i]->categoryId; ?>" <?php if(getParameter($_POST, "level", '') == $rsCategory[$i]->categoryId) {?> selected="selected" <?php } ?>><?php echo $rsCategory[$i]->category_name; ?></option> <?php } ?> </select></td> </tr> <tr> <td width="24%" align="right"><p>Additional Details (Optional)</p></td> <td width="76%" align="left"><p> <textarea style="width:355px;" cols="40" rows="9" name="question" id="question"><?=getParameter($_POST, "question", '')?></textarea> </p></td> </tr> <tr> <td align="right"><b><p>Quick Hint:</b></p></td> <td align="left"><p>It is important that you let the others users understand exactly what you wish to know. Be as specific as possible (list any technical information, etc) in order to get precise and suitable answers.</p><td> </tr> <tr> <td width="50%"><p>Anti-Spam: <br /> <a href="javascript:poptastic('http://recaptcha.net/popuphelp/');">(Get Instructions)</a></p></td> <td width="50%"><?=recaptcha_get_html($publickey, $error);?></td> </tr> <tr> <td colspan="2" align="left"></td> </tr> <tr> <td> </td> <td><input type="submit" name="cmdAdd" id="cmdAdd" value="Ask This Question" <?php if($_POST['act'] == 'edit') {?>disabled="disabled"<?php } ?>/> </td> </tr> </table> </td> </tr> </table> </form> </DIV> <DIV class=dotted-line></DIV> </DIV> </DIV> </DIV> <?php include("includes/bottom.php");?> <script language="javascript"> function updateButton() { if (document.frmQuestion.title.value=="" || document.frmQuestion.level.options.selectedIndex==0) { document.frmQuestion.cmdAdd.disabled=true; document.frmQuestion.cmdAdd.value='Please Fill In All The Needed Information'; } else { document.frmQuestion.cmdAdd.disabled=false; document.frmQuestion.cmdAdd.value='Ask This Question'; } } updateButton(); </script> Quote Link to comment https://forums.phpfreaks.com/topic/200996-please-help-me-urgent-matter/#findComment-1054531 Share on other sites More sharing options...
trq Posted May 7, 2010 Share Posted May 7, 2010 Seriously, have a read of the 'How To" link in my signature and try again. You need to properly describe your problem, tell us what you have tried to rectify the problem and then post relevant and only relevant code. Quote Link to comment https://forums.phpfreaks.com/topic/200996-please-help-me-urgent-matter/#findComment-1054536 Share on other sites More sharing options...
Guest davidbugeja Posted May 7, 2010 Share Posted May 7, 2010 I am not an expert at all in PHP What is bothering me is that I have changed nothing all and today walla it is not working. The Problem: All text is accepted in the form however if i type a link or anything that contains http:/ the page gives me a Page Cannot Be Displayed when I press Ask This Question. I have tried everything I could think of such as remove parts of the code to see where it gets stuck but no success! Quote Link to comment https://forums.phpfreaks.com/topic/200996-please-help-me-urgent-matter/#findComment-1054537 Share on other sites More sharing options...
Guest davidbugeja Posted May 7, 2010 Share Posted May 7, 2010 Please help. I am really frustrated and I do not know what might be the cause. Quote Link to comment https://forums.phpfreaks.com/topic/200996-please-help-me-urgent-matter/#findComment-1054547 Share on other sites More sharing options...
Guest davidbugeja Posted May 7, 2010 Share Posted May 7, 2010 This part of the code: <textarea style="width:355px;" cols="40" rows="9" name="question" id="question"><?=getParameter($_POST, "question", '')?></textarea> Does not accept any text begining with ftp:// or http://. All other text gets accepted. It is like the code is filtering these protocols. Quote Link to comment https://forums.phpfreaks.com/topic/200996-please-help-me-urgent-matter/#findComment-1054560 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.