|
I have installed apache for windows vista. I have configured apache to use Lister:8888 in my httpd.conf and my web service is running. I have both .pl and .cgi files in the ../cgi-bin folder of the apache web folder. I do not have any other webservers running. When I try to display a page (http://localhost:8888/cgi-bin/test.pl or http://localhost:8888/cgi-bin/webpage.cgi). I get the ie error: "localhost is not set up to establish a connection on port "8888" with this computer." Now, if I try http://localhost/cgi-bin/test.pl I get the error "localhost is not set up to establish a connection on port World Wide Web service (HTTP) with this computer. Can anyone help?
Thanks,
Steve Holdorf
|
|
|
|
|
I checked the event logs and have the follow error:
The Apache service named
reported the following error: >>>
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Hope this helps.
|
|
|
|
|
Have you solved this yet? are you using it as a development or live server (is it visible to the world or just you?)?
|
|
|
|
|
Hi all
Need help on frame breaker code.
i have a page with two frames in it.the pages are built in PHP.
the first page displays page from my site whereas the second frame displays page from the other site for which i do not have control on.
but for some sites that do have a frame breaker code in them, those pages open in the parent window rather than opening in the frame.
have tried the security TAG in Iframe but it works only in IE.
for mozilla its of no use.
tried a few things but to no effect.
tried from this link
http://coderrr.wordpress.com/2009/02/13/preventing-frame-busting-and-click-jacking-ui-redressing/[^]
is it even possibe to do so.
Pls help
Thanks in Advance.
Sandeep
|
|
|
|
|
It seems to me, that the way I'd approach it is to do a GET on the desired page, scan the page for any offending code and fix as required.
From the 2minute primer i've just had, it looks like a couple of prime strings to be commented out are "top.location= xxxxxxx" and "top.location.replace"
I guess I'd just try loading the page into a string, and inserting a pair of '/' characters at the start of any line that contains either of the two strings I mentioned. That way, you've killed the javascript before it ever had a chance.
|
|
|
|
|
hi enhzflep
thanks for the reply.
can u pls elaborate with the code so that i can understand it.
also if we try to get a page in a string and strip of the Javascript(frame breaker code) then what is the way to display the stripped content in a iframe.
please have a look at the following link
http://www.iframehtml.com/iframe-scripts.html[^]
it tells way to strip the JS from the page but how to display that page in a iframe then
Regards
Sandeep.
|
|
|
|
|
That's okay Sandeep. Thank-you for introducing me to the whole concept. It's been rather an interesting exercise.
I've had a little play around, and come up with some code that will kill the framebuster in a page that I've been playing with.
It's a two-file approach. There's the html file that makes the request, and the php file that retrieves the requested file
then strips the offending code from it.
In my simple example, I simply replace "top.location=self.location;" with "alert('Framebuster busted!');"
All you'll have to do is to find, download and compress AjaxRequest.js (EDIT: http://www.ajaxtoolbox.com/request/source.php)
[EDIT: No, you don't. I forgot I used a different method. Anyhow, it's still a good library]
Here's some code to play with:
1. getPage.php
<?php
$url = $_GET["tgt"];
if ($url == "")
die("goddamit");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
echo strip_javascript($data, 0);
function strip_javascript($filter, $allowed=0)
{
$filter = str_replace("top.location=self.location;", "alert('Framebuster busted!');", $filter);
return $filter;
}
?>
2. showInIFrame.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script type="text/javascript">
function onGoBtn()
{
var url, ifrm, src;
url = document.getElementById("urlInput").value;
ifrm = document.getElementById("tgtFrame");
src = "getPage.php?tgt="+url+"&rand="+parseInt(Math.random()*100);
ifrm.src = src;
}
</script>
</head>
<body>
<label>URL
<input type="text" name="urlInput" id="urlInput" value="www.freedb.org">
</label>
<br>
<label>Load into IFrame
<input type="button" name="goBtn" id="goBtn" value="GO!" onclick="onGoBtn();">
</label>
<br>
<iframe id="tgtFrame">Target Frame</iframe>
</body>
</html>
modified on Wednesday, September 23, 2009 1:23 AM
|
|
|
|
|
Is there a Python debugger that isn't complete rubbish? I just tried PyScripter and it crashes. I understand Eclipse doesn't have breakpoints which makes no sense to me. I tried WinPdb and the installer crashes.
PS. Looks like Wing IDE works.
modified on Wednesday, September 16, 2009 5:50 PM
|
|
|
|
|
|
u could use the pdb..commandline debugger
|
|
|
|
|
how can i upload and save image on server,i want fullcode because my code work locally but not on server
|
|
|
|
|
No one is going to do your work for you here, try www.rentacoder.com.
I hear they do work...for a price.
|
|
|
|
|
|
how can we send email from php,i know mail function but no idea about SMTP
|
|
|
|
|
SMTP settings are in the php.ini file.
Some help with editing them can be found here[^].
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Hi,
I am new to php,I want to show a table in grid.need help.
|
|
|
|
|
It's not PHP, but look into HTML tables[^].
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
I was playing with something the otherday that might be whhat you'r after.
It just displays a (dynamically generated, in this simple example) table, and allows editing by just double-clicking a cell.
<pre><!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function makeEdit(tgtObj)
{
tgtObj.ondblclick="";
tgtObj.innerHTML = '<input class="myInput" type="text" value="' + tgtObj.innerHTML + '" />';
}
function makeSelect(tgtObj)
{
var oldStr, newStr;
oldStr = tgtObj.innerHTML;
newStr = '<select class="myInput" name="select"><option value=0>0</option><option value=1>1</option></select>';
tgtObj.ondblclick="";
tgtObj.innerHTML = newStr;
}
// called by the ondblclick function of a table <td> </td> cell
function editModeOn()
{
var curCol, btnIdStr="";
var tgtRowObj = this.parentNode;
var numCells = tgtRowObj.cells.length;
var rand_no = Math.ceil(100*Math.random());
btnIdStr = "btn_"; btnIdStr += rand_no;
for (curCol=0; curCol<numCells-1; curCol++)
{
makeEdit(tgtRowObj.cells[curCol]);
}
tgtRowObj.cells[curCol].ondblclick = null;
tgtRowObj.cells[numCells-1].innerHTML = "<input type='button' id='"+btnIdStr+"' value='save'/>";
// tgtRowObj.cells[numCells-1].onclick=null;
document.getElementById(btnIdStr).onclick=editModeOff;
}
function editModeOff()
{
var str = "editModeOff: " + this.id;
var parentCell = this.parentNode;
var parentRow = parentCell.parentNode;
var tgtObj = parentRow;
var i, n, numCells, thisCell;
numCells = tgtObj.cells.length;
for (i=0; i<numCells-1; i++)
{
thisCell = tgtObj.cells[i];
for (n=0; n<thisCell.childNodes.length; n++)
{
if (thisCell.childNodes[n].nodeType == document.ELEMENT_NODE)
{
thisCell.innerHTML = tgtObj.cells[i].childNodes[n].value;
}
thisCell.ondblclick=editModeOn;
}
}
tgtObj.cells[i].innerHTML = "BTN";
}
function makeTable(cols, rows, newTableId, tgtId)
{
var y, x, str="", tgtObj = document.getElementById(tgtId);
var width = 120;
width *= cols;
str = "<table style='table-layout:fixed;' width='"+width+"px' id='" + newTableId + "'>";
for (y=0; y<rows; y++)
{
if (y%2 == 0)
str += "<tr class='evenRow'>";
else
str += "<tr class='oddRow'>";
for (x=0; x<cols; x++)
{
str += "<td>("+(x+1)+","+(y+1)+")</td>\n";
}
str += "</tr>";
}
str += "</table>";
tgtObj.innerHTML = str;
attachOnclickFunction(newTableId);
}
function attachOnclickFunction(tgtTblId)
{
var tgtObj = document.getElementById(tgtTblId);
var tabRows = document.getElementById(tgtTblId).rows;
var curColNum, curRowNum;
var curCell;
for (curRowNum=0; curRowNum<tabRows.length; curRowNum++)
{
curRow = tabRows[curRowNum].cells;
for (curColNum=0; curColNum<curRow.length; curColNum++)
{
curRow[curColNum].ondblclick = editModeOn; //showParentId;
curRow[curColNum].className = "clickAble";
}
}
}
</script>
<style>
td{
border-width: 1px;
margin:0px;
padding:0px;
text-align: center;
height: 1.5em;
overflow:hidden;
}
.clickAble{
cursor: pointer;
}
.highlightAble:hover{
border-color:#00FF00;
background-color:#F0FFF0;
}
.highlightAble:active{
border-color:#FF0000;
background-color:#FFF0F0;
}
.evenRow{ border-color:#00FF00; background-color:#FFFFFF; }
.evenRow:hover{ background-color:#E0FFE0; }
.evenRow:active{ background-color:#D0FFD0; }
.oddRow{ border-color:#FF0000; background-color:#F0F0F0; }
.oddRow:hover{ background-color:#E0FFE0; }
.oddRow:active{ background-color:#D0FFE0; }
.evenRow td{
border-left-style:none;
border-right-style:none;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-bottom-style: solid;
border-color: #CCCCCC;
}
table{
border-collapse: collapse;
}
.myInput{
width: 99%;
border-style:none;
text-align:center;
}
.myInput:hover{
background-color: #E0FFE0;
font-weight: bold;
}
.myInput:focus{
background-color: #D0FFD0;
font-weight: bold;
}
</style>
</head>
<body onload="makeTable(10, 10, 'myTable', 'test1');">
<span id="test1"></span>
</body>
</html></pre>
S.
|
|
|
|
|
I'm not a fan of just writing HTML with javascript e.g. str += '</tr>';
I would rather use the document.createElement( [tag name] ); function. I'm also a huge fan of jQuery.
Below is how I would go about creating a table in Javascript.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Create Table</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
function createTable(rows, columns, newId, parent)
{
$(parent)
.append(
$(document.createElement('table'))
.attr('id' , newId)
);
for (var rowNumber = 1; rowNumber <= rows; rowNumber++)
{
$('#' + newId)
.append(
$(document.createElement('tr'))
.attr('class', (rowNumber % 2 == 0) ? 'even' : 'odd')
);
for (var columnNumber = 1; columnNumber <= columns; columnNumber++)
{
$('#' + newId + ' tr:last-child')
.append(
$(document.createElement('td'))
.html('(' + columnNumber + ', ' + rowNumber + ')')
);
}
}
}
</script>
</head>
<body onload="createTable(10, 10, 'newTable', '#parent');">
<div id="parent"></div>
</body>
</html>
Boredom is a wonderful thing.
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Hi,
I am very new to linux. I have installed Fedora 11 on my laptop. I have installed yahoo messenger but it does not get start.
When I click on log on,It give error "le gdkfont.c: line 239 (gdk_font_ref): assertion `font != NULL' failed." on the console.
Can anyone please help me to solve this?
Thanks and Regards,
Vishal Soni
|
|
|
|
|
Hi all,
I want to create a PHP IDE.How can i do it ?
Thanks in advance.......
|
|
|
|
|
Pick a language - java/c++/C# are probably best, but you could try php & tk (but it's painful). Learn how to build windows and forms with it.
Plan your application on paper n get coding.
I suggest looking at some coding tutorials first. c# and wpf are probably a good starting point.
|
|
|
|
|
Hi every one,
I was to post data to page(WAP page).I did this using CURL.but seems some error.Server responses with Internal Error.I dont know where i am going wrong Can be Cookie or can be any thing else.Can any one help me out of this.HERE IS MY CODE
Regards,
Pavan.
modified on Monday, September 7, 2009 12:50 PM
|
|
|
|
|
Hi,
I am a windows programmer with more than 10 years experrience and am newly venturing into the world of web development (specifically PHP). I would like to know what most PHP developers do to create visual content i.e. do they use a HTML editor like Frontpage or Dreamweaver and intersperse the generated code with PHP code or do they code everything by hand?
I posted the same question in another forum and got the reply that PHP is mostly coded by hand. That appears a bit daunting since creating a single page could involve writing more than a thousand lines of HTML code. I can't believe people are still hand coding thousands of lines of code in this age of visual development tools. Is there some easy way around this?
|
|
|
|
|
Visual development tools can help - but the problem is if you know your code then writing it by hand is a lot quicker - also there isn't a program that can write good php code for you. Aptana Studio can help you write class getter and setters in code and a few other programs have similar useful features but that's about it. DW does have a useful quick css properties editor.
If you have a good coloured coded IDE with good intellisense (code helper) then it will always be quicker to code by hand.
The good thing with php is you can reuse your code by using includes, functions and classes. So you can make a header and footer for your website once and just reference it in the other files (much the same as calling functions in windows programmed classes). You can process and validate form data and work with cookies and session variables. And that's just the start, PHP also has a multitude of other functions.
You should try to build yourself a php code library from the start and keep upgrading the different elements.
Personally, I create everything except images in DW. Once you know the keyboard shortcuts it's a breeze. I use FileZilla FTP instead of DW FTP.
I also install a copy of notepad++ on all my clients servers - small footprint but has code colouring for a range of file types.
|
|
|
|