|
|
I have follwoing code.
I have 2 variables in the XML file that I am reading here, Item no and name.
Then I created a folder item_Name in the 3rd column of the page so that when I click it it should take me to the folder.
The file is in the root folder.
Can someone let me know whats wrong with following cell
<td>
<div>
<a href="{&URL1}_{&URL2}"><xsl:value-of select="Folder"/></a>
</div></td>
-----------here's the full code -------------------------------------------------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/rss">
<html>
<head>
<title>RSS feed</title>
</head>
<body>
<table width="100%" cellspacing="0">
<tr><td><H1><center>Welcome</center></H1></td></tr>
<tr><td><H2>Click on a column header to sort by each column.</H2></td></tr>
<tr><td><DIV id="listing"><xsl:apply-templates match="NotesDocuments"/></DIV></td></tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="NotesDocuments">
<table STYLE="background-color=beige">
<thead>
<td><DIV class="hd" onClick="sort('item no')">no</DIV></td>
<td><DIV class="hd" onClick="sort(Name')">Name</DIV></td>
<td><DIV class="hd" onClick="sort('folder')">folder</DIV></td>
</thead>
<xsl:for-each select="NotesData" order-by="TITLE">
<tr>
<td><DIV class="rw"><xsl:variable name="URL1"><xsl:value-of select="no"/></xsl:variable></DIV></td>
<td><DIV class="rw"><xsl:variable name="URL2"><xsl:value-of select="Name"/></xsl:variable></DIV></td>
<td>
<div>
<a href="{&URL1}_{&URL2}"><xsl:value-of select="Folder"/></a>
</div></td>
</tr>
</xsl:for-each>
</table>
</xsl:stylesheet>
|
|
|
|
|
|
I like to submit a request to a web service and wait for the response. I have to give web service a page name where I should the response. <asp:button postbackurl="SomePage"" runat="server"> but I am unable to find any reference to PostBackUrl in MVC. In other word how are we going to deal with PostBackUrl or how we can provide return CallBack page?
|
|
|
|
|
Not clear on what are you trying to ask here. You start by requesting a webservice on one end and then ended up asking postback url in MVC. Please update your question and clearly specify about your work and need.
|
|
|
|
|
Well I send a SMS (message) through a service provider, where server provider is asking me the web address where to inform back for the result as a success or fail.
You may look complete example at (Working example and you play it to understand it)
http://www.w3schools.com/aspnet/showasp.asp?filename=demo_prop_webcontrol_button_postbackurl
<!DOCTYPE html>
<html>
<body>
<form runat="server">
Name:<asp:textbox id="TextBox1" runat=Server />
<asp:button id="Button1" Text="Submit"
PostBackUrl="demo_postbackurl.aspx" runat="Server" />
</form>
</body>
</html>
As you see asp:button has property PostBackUrl, but as far as I know there is no button implementation under MVC3. The service provider only take web address as a PostBackUrl to return the status of the MSM call.
I hope I explained well. Thank you very much for the reply.
|
|
|
|
|
Hi, I have a problem, I don't know how to convert .dbf in FoxPro to MySql using PHP. Who can help me?
|
|
|
|
|
Gday, I dunno how to do it either.
But Google does! Entering your thread title (only) yielded 84,000 results. Presumably one of the first 10 will suffice?
Here you go: from+.dbf+FoxPro+to+MySql[^]
|
|
|
|
|
hehehe..Thanx for your attention before Sir.
I know Sir, I have done it before..
but my code is not give solution..
It can't open the .dbf file..
it's error said that lenght parameter must be greater than 0.
what happen with it?
Thanx before.. Smile |
|
|
|
|
|
A sense of humour and polite. Nice!
That's enough to get continued effort form me right now.
I don't know "what happen with it?"
Can you show the line of code that fails?
|
|
|
|
|
heheheh..thanx Sir..
this is the code Sir..
I don't know where is the wrong code,
because I think it's already right n it have used by another person n when I just try I can't..
sorry if u feel bothered..
<?php
class dbf_class {
var $dbf_num_rec;
var $dbf_num_field;
var $dbf_names = array();
var $_raw;
var $_rowsize;
var $_hdrsize;
var $_memos;
function dbf_class($filename) {
if (!file_exists($filename)) {
echo "<script>alert('Masukkan data DBF')</script>";
} else {
$handle = fopen($filename, "r");
}
if (!$handle) {
echo "Cannot read DBF file";
}
$filesize = filesize($filename);
$this->_raw = fread($handle, $filesize);
fclose($handle);
$arrHeaderHex = array();
for ($i = 0; $i < 32; $i++) {
$arrHeaderHex[$i] = str_pad(dechex(ord($this->_raw[$i])), 2, "0", STR_PAD_LEFT);
}
$line = 32;
$this->dbf_num_rec = hexdec($arrHeaderHex[7] . $arrHeaderHex[6] . $arrHeaderHex[5] . $arrHeaderHex[4]);
$this->_hdrsize = hexdec($arrHeaderHex[9] . $arrHeaderHex[8]);
$this->_rowsize = hexdec($arrHeaderHex[11] . $arrHeaderHex[10]);
$this->dbf_num_field = floor(($this->_hdrsize - $line ) / $line);
for ($j = 0; $j < $this->dbf_num_field; $j++) {
$name = '';
$beg = $j * $line + $line;
for ($k = $beg; $k < $beg + 11; $k++) {
if (ord($this->_raw[$k]) != 0) {
$name .= $this->_raw[$k];
}
}
$this->dbf_names[$j]['name'] = $name;
$this->dbf_names[$j]['len'] = ord($this->_raw[$beg + 16]);
$this->dbf_names[$j]['type'] = $this->_raw[$beg + 11];
}
if (ord($this->_raw[0]) == 131) {
$tail = substr($tail, -1, 1);
if ($tail == 'F') {
$tail = 'T';
} else {
$tail = 't';
}
$memoname = substr($filename, 0, strlen($filename) - 1) . $tail;
$handle = fopen($memoname, "r");
if (!$handle) {
echo "Cannot read DBT file";
exit;
}
$filesize = filesize($memoname);
$this->_memos = fread($handle, $filesize);
fclose($handle);
}
}
function getRow($recnum) {
$memoeot = chr(26) . chr(26);
$rawrow = substr($this->_raw, $recnum * $this->_rowsize + $this->_hdrsize, $this->_rowsize);
$rowrecs = array();
$beg = 1;
if (ord($rawrow[0]) == 42) {
return false;
}
for ($i = 0; $i < $this->dbf_num_field; $i++) {
$col = trim(substr($rawrow, $beg, $this->dbf_names[$i]['len']));
if ($this->dbf_names[$i]['type'] != 'M') {
$rowrecs[] = $col;
} else {
$memobeg = $col * 512;
$memoend = strpos($this->_memos, $memoeot, $memobeg);
$rowrecs[] = substr($this->_memos, $memobeg, $memoend - $memobeg);
}$beg+=$this->dbf_names[$i]['len'];
}
return $rowrecs;
}
function getRowAssoc($recnum) {
$rawrow = substr($this->_raw, $recnum * $this->_rowsize + $this->_hdrsize, $this->_rowsize);
$rowrecs = array();
$beg = 1;
if (ord($rawrow[0]) == 42) {
return false;
}
for ($i = 0; $i < $this->dbf_num_field; $i++) {
$col = trim(substr($rawrow, $beg, $this->dbf_names[$i]['len']));
if ($this->dbf_names[$i]['type'] != 'M') {
$rowrecs[$this->dbf_names[$i]['name']] = $col;
} else {
$memobeg = $col * 512;
$memoend = strpos($this->_memos, $memoeot, $memobeg);
$rowrecs[$this->dbf_names[$i]['name']] = substr($this->_memos, $memobeg, $memoend - $memobeg);
}
$beg+=$this->dbf_names[$i]['len'];
}
return $rowrecs;
}
}
?>
|
|
|
|
|
Hmmm. Okay - that was actually the class I was going to recommend you use.
Now then, the text "length" appears in that document 3 times - each of these are in the comments.
I also see that it doesn't include any other php files, so I can only deduce that the error message is coming from MySql itself. Its very difficult to tell, since you didn't copy/paste the exact error message. (I doubt the error message is going to spell 'length' as 'lenght' )
This makes me consider the possibility that there is in fact, nothing wrong with this code, and that the problem lies in the database structure.
Another alternative is that (& I don't know) perhaps the FoxPro database has a field with NULL in it and you're trying to insert that, but since there's no value, an empty parameter is being passed to mysql, rather than a zero or NULL value..
However, since the code has been around for so long, (at least since 2004) it seems unlikely that it still has an error.
I see that you've made this modification:
if (!file_exists($filename)) {
echo "<script>alert('Masukkan data DBF')</script>";
}
In the original code, there is an exit statement in that block, so that execution wont continue if there's a problem. In your case, it does! (continue if there's a problem)
I'd change that quick-smart!
if (!file_exists($filename))
{
echo 'Masukkan data DBF'"
exit;
}
I suggest that you add some more printf/echo statements to the class to let you know when execution passes certain arbitrary points. A good first location would be after the file has been read and then closed.
At least then you can know where processing gets to before failure - this lets you know which data is being processed at this point and dismiss or confirm that it's the data.
But in any case, often a quick way is to add more echo statements so you know where execution fails.
Good luck.
|
|
|
|
|
thanx sir..
Sir, finally this is the error when I browse the file .DBF...
A PHP Error was encountered
Severity: Warning
Message: fopen(DRBS.DBF) [function.fopen]: failed to open stream: No such file or directory
Filename: models/dbf_class.php
Line Number: 18
Cannot read DBF file
A PHP Error was encountered
Severity: Warning
Message: filesize() [function.filesize]: stat failed for DRBS.DBF
Filename: models/dbf_class.php
Line Number: 22
A PHP Error was encountered
Severity: Warning
Message: fread() expects parameter 1 to be resource, boolean given
Filename: models/dbf_class.php
Line Number: 23
A PHP Error was encountered
Severity: Warning
Message: fclose() expects parameter 1 to be resource, boolean given
Filename: models/dbf_class.php
Line Number: 24
|
|
|
|
|
Susy Nainggolan wrote: fopen(DRBS.DBF) [function.fopen]: failed to open stream: No such file or directory
BINGO!
So what's the full path to:
- dbf_class.php
- DRBS.DBF
- The file that creates the instance of the dbf_class
Also, is the cAsE correct for DRBS.DBF?
Is it drbs.dbf perhaps?
|
|
|
|
|
hi
Please I try to retrieve data from web services (soap) and must pass an ID in cookie http header I tried with java code (eclipse) but I can not I tried also with other tools tjrs but its not happening ...
I am beginner I really need a helping hand to find the error and the tool to be used
Thank you in advance
My prob is in the URL: I can not add it and how to add the "sid"on url (sid: is the username (cookie))
|
|
|
|
|
|
|
Just a suggestion - please don't post so much of code here. you might be working for some employer and if he finds out that the code is being leaked on public forums you might get in trouble.
Post just the stuff that is causing the problem. always be discreet while giving code. make sure you don't violate the employes NDA in any way. we don't want you to get in trouble.
Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.
|
|
|
|
|
thx for advice i delet the code
|
|
|
|
|
Hi,
I want to know how can I format a number like this:
year = 2012
month = 7
it should be:
year = 2012
month = 07
then bill_code = 201207 (as int)
|
|
|
|
|
int bill_code = 100 * year + month;
|
|
|
|
|
Hello Guys,
I, Vadim Segal, is here to discuss my query regarding website Contact Us Page.I have a website developed in PHP. The contact us page of the website display the contact detail , but now I want to modify this page and want to add the contact us form to this page. So that , whenever the visitor enter their query, it can directly come to mail address. Please help me with your valuable advice.
Thanks
Vadim
|
|
|
|
|
I wrote an article on creating a .Net REST service.
.NET REST service[^]
I hoped to re-write the REST aspects utilizing a .Net restful service open source project. I'm avoiding WCF, as it is counter-REST (light-weight/simple). I am thinking of something fluent, spring-like, convention over configuration. It needs to be robust, handle all the verbs, async, file transfers and auth/security.
I can't find anything at all. Anyone have any leads for a .Net library or Java libraries that could be ported? There may also be an opportunity to start an open source project.
Thanks,
-Bruce
-bruce
|
|
|
|
|
Hello,
i want to make an attendance system in asp.net i have made two tables
1.attence_record (in which i have attendance record like record_id, date, class, subject)
2.raw_att (in which i have particular date and subject attendance)
record_id is foreign key in rwa_att.
now i want to create a grid view control to get the status of particular student.
i also need a dropdown for filling status. that is the main problem.
|
|
|
|
|
Ajit0010 wrote: i want to make an attendance system in asp.net
Ok. Good idea.
Ajit0010 wrote: 1.attence_record (in which i have attendance record like record_id, date, class, subject)
2.raw_att (in which i have particular date and subject attendance)
record_id is foreign key in rwa_att.
Create two tables with column as per need
Ajit0010 wrote: now i want to create a grid view control to get the status of particular student.
Use ADO.NET to get data from DB and use it for display in grid
Ajit0010 wrote: i also need a dropdown for filling status.
Assuming, you meant dropdown in grid, this should give you some idea:
MSDN: Walkthrough: Displaying a Drop-Down List While Editing in the GridView Web Server Control[^]
Now, try first what you want to do! You may find that it's not that hard. Formulate what was done by you that looks like an issue/not working.
|
|
|
|