|
Hmm... I actually have no idea about PHP , but if I understand the question...
No, you don't have to have a different file. Remember that PHP is a server-side scripting language, that means you are writing the final HTML code (which the user will see) right from your .php file. Like this (as I said I dunno PHP, so writing the example like in JavaScript)
if(someVariableYouHave){
write("<H1>Hello mister</H1>");
}else{
write("<H3>Good bye, sir</H3>");
}
So if the variable "someVariableYouHave" is true, the end-user will see "Hello mister", otherwise "Good bye"
Philip Patrick
"Two beer or not two beer?" <shakesbeer>
Web-site: www.saintopatrick.com
|
|
|
|
|
|
I've just written a JavaScript collapsible table of contents for my website. It works on the basis of using the display style for the child rows.
I use Macromedia DreamWeaver to manage my site, so the table of contents is a library item that is then added to a template. The template is applied to all pages (except the home page), so the code is exactly the same on all pages and looks like this:
<table width="125" border="0" cellspacing="0" cellpadding="0" bgcolor="#FF0000">
<tr>
<td><a href="..\index.htm" class="ParentMenuItem">Home</a></td>
</tr>
<tr>
<td><a href="..\about.htm" class="ParentMenuItem">About</a></td>
</tr>
<tr>
<td><a href="..\contact.htm" class="ParentMenuItem">Contact</a></td>
</tr>
<tr>
<td id="News" class="ParentMenuItem" onClick="
var rowIDs = new Array ();
rowIDs[0] = Salamander;
rowIDs[1] = Headlines;
showHideRows (News, rowIDs, 2);">+News</td>
</tr>
<tr id="Salamander" style="display: none;">
<td><a href="..\news.htm" class="SubMenuItem">Salamander</a></td>
</tr>
<tr id="Headlines" style="display: none;">
<td><a href="..\headline.htm" class="SubMenuItem">Headlines</a></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td id="Products" class="ParentMenuItem" onClick="
var rowIDs = new Array ();
rowIDs[0] = CButtonSSL;
rowIDs[1] = CListCtrlSSL;
rowIDs[2] = CTabCtrlSSL;
rowIDs[3] = WinDiff;
showHideRows (Products, rowIDs, 4);">+Products</td>
</tr>
<tr id="CButtonSSL" style="display: none;">
<td><a href="..\products\cbuttonssl.htm" class="SubMenuItem">CButtonSSL</a></td>
</tr>
<tr id="CListCtrlSSL" style="display: none;">
<td><a href="..\products\clistctrlssl.htm" class="SubMenuItem">CListCtrlSSL</a></td>
</tr>
<tr id="CTabCtrlSSL" style="display: none;">
<td><a href="..\products\ctabctrlssl.htm" class="SubMenuItem">CTabCtrlSSL</a></td>
</tr>
<tr id="WinDiff" style="display: none;">
<td><a href="..\products\windiff.htm" class="SubMenuItem">WinDiff Add-in</a></td>
</tr>
<tr>
<td colspan="2" id="Services" class="ParentMenuItem" onClick="
var rowIDs = new Array ();
rowIDs[0] = Software;
rowIDs[1] = WebDesign;
rowIDs[2] = Graphics;
showHideRows (Services, rowIDs, 3);">+Services</td>
</tr>
<tr id="Software" style="display: none;">
<td><a href="..\services\software.htm" class="SubMenuItem">Software</a></td>
</tr>
<tr id="WebDesign" style="display: none;">
<td><a href="..\services\webdes.htm" class="SubMenuItem">Web Design</a></td>
</tr>
<tr id="Graphics" style="display: none;">
<td><a href="..\services\graphics.htm" class="SubMenuItem">Graphics</a></td>
</tr>
<tr>
<td><a href="..\support.htm" class="ParentMenuItem">Support</a></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><a href="..\clients.htm" class="ParentMenuItem">Clients</a></td>
</tr>
<tr>
<td><a href="..\projects.htm" class="ParentMenuItem">Projects</a></td>
</tr>
</table>
The showHideRows is in a separate file, contents.js which is referenced in the page body in the template using the following:
<SCRIPT Language="JavaScript" src="..\_private\contents.js"></SCRIPT>
The content of the javascript is as follows:
function showHideRows (parentRow, rowIDs, rowCount) {
var strInnerText = parentRow.innerText;
for (i = 0; i < rowCount; i++) {
if (strInnerText.charAt (0) == '+') {
rowIDs[i].style.display = "";
}
else {
rowIDs[i].style.display = "none";
}
}
var strLabel = strInnerText.slice (1);
if (strInnerText.charAt (0) == '+') {
parentRow.innerText = '-' + strLabel;
}
else {
parentRow.innerText = '+' + strLabel;
}
}
The problem is that for two of the pages, the 'Products' part of the menu does not work, because one of the IDs is not the actual row it is supposed to be and so trying to change it's style fails in the function. Rather than being a element with it's multitude of properties, it has two properties, length and _enum . The pages in question are Products\CButtonSSL and Products\CTabCtrlSSL.
If it works for all the other pages using exactly the same code, why doesn't it work for these two?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
Well, dunno what the problem, but the solution is:
Use document.getElementById() to get a reference to HTML element, it is working fine, just tried. Plus you will get it cross-browser, otherwise your code won't work on Netscape.
Example:
rowIDs[0] = document.getElementById('Software');
Happy programming
Philip Patrick
|
|
|
|
|
Thanks very much, Philip. I'll give it a go
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
im very new to html. I have two .wav files and i want to have one played, then when that one finishes, it plays the next one. I tried using the bgsound tag but that played them both at the same time. How can I accomplish this without having to combine the two .wav files into one?
-Raffi
|
|
|
|
|
I have an idea, but it is not perfect at all.. Just to make things work before you'll find a better solution.
You know the length of your .wav file, right? So make a timer in your Javascript and just change the src attribute of BGSOUND when the time is off.
A little suggestion. You can preload your second file while the first is playing, to make things smoother
Philip Patrick
"Two beer or not two beer?" <shakesbeer>
Web-site: www.saintopatrick.com
|
|
|
|
|
Raffi wrote:
im very new to html. I have two .wav files and i want to have one played, then when that one finishes, it plays the next one. I tried using the bgsound tag but that played them both at the same time. How can I accomplish this without having to combine the two .wav files into one?
This is an indirect solution to your problem and may not suit you.
Use Flash. If you are willing to put WAV files into your page (which IMHO is not such a good idea for most websites) then it should be no problem putting a Flash file in.
Simply create a SWF file with the two WAV files imported in. You can control quite a bit of the timing and looping with Flash. Then insert the SWF file into your HTML (Flash gives you the code to do this.)
You do not even need the Flash file to have a visual UI, just make the width and height 0 or put it in the HEAD.
* Do note: I do not advise putting either Flash or sound files into web pages. Both are annoying, make for large web pages, are not a standard and do not actually add much to your site. If you want people to hear something you have created then let them download or stream it from a link that they click.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
"The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge
Martin Marvinski wrote:
Unfortunatly Deep Throat isn't my cup of tea
Do you Sonork? I do! 100.9903 Stormfront
|
|
|
|
|
I have one vc++ application.In that i have taken exe and i made a cab file.One .ocx control is present this ocx calls the exe file.I placed the cab file in net,so whenever a user clicks one link then the cab file is calling.So that my exe file is executing.Actually my ocx component is having the virisign registration.So,my component is providing some security to the user sytem.For security purpose it is showing one dialog box that is showing this message.
"Warning:The authority of this content can't be verified,therefore it can't be trusted.
Problem Listed below
The test root has not been enabled as a trusted root.Do you want to install and run the "abc" signed on 2001-12-11,....etc."
My Doubt:Even though i have registered ocx component,but it is showing this type of dialog box like the authority of this content can't be verified.
So,is it problem of creation of cab file.So,how can i solve my problem.So that i can supply trusted software to all endusers.
Can anybody help me in this case.
it is a company which deals with AI and different
types of web based applications
|
|
|
|
|
Help Help Help
I read and used the article "Adding a search facility to your website" from this site. Very useful but I'm having a problem instantiating it on a Win NT server. It works well on my Win 2k web server/laptop.
I coded the asp to use a specific catalog because the one for this site is not the default catalog. When I put it (the html pages and catalog) on the NT server and used the search facility despite my specifying a catalog to use, it is still searching everything on the server that has the search term(s). I have the catalog only using the site's specified file folders.
What am I missing or doing wrong??? I'm going to pull my hair out over this real soon.
Thanks,
Dia
|
|
|
|
|
Hello everyone,
I have a couple of questions that I hope someone can help me with
Computer OS: Win2k Web Server: IIS 5.0
1. I am working on an ASP page that will access my Access Database so visitors will be able to search my site. It is going to search through a field with a Memo data type(thanks John!). I thought it would work if I used the following SQL statement:
"SELECT * FROM Content WHERE Contents LIKE '%search'" . I decided to use the "LIKE" statement for the following reason: I designed my database was to have a table called "Content" with two fields "Contents" and "Page". I entered the webpages content into "Contents" and put the name of the html document in the “Page” field. If the “LIKE” statement found the keyword it would do a Request.Write(search) in an HTML tag that the visitor could then click. My problem is it doesn’t work so I’m submiting what I have and maybe an undeniable great Guru and Programming expert such as John can help me.
<%
var search = Request.Form("Search_Form");
var oConn;
var oRs;
var filePath;
var Index;
var strsearch = "SELECT * FROM Content WHERE Contents LIKE " + " \' %" + search + " \' ";
var filePath = Server.MapPath("Search.mdb");
oConn = Server.CreateObject("ADODB.Connection");
oConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +filePath);
oRs = oConn.Execute(strsearch);
%>
<%
while (!oRs.eof) { %>
<% for(Index=0; Index < (oRs.fields.count); Index++) { %>
<% } %>
<% oRs.MoveNext();
}
%>
My last question is on JavaScript. I have an html page that has a form. I want to get the data the user entered into the form in anouther part of the page. The problem is that I don’t know how to do that without having to do . I just want it to retrieve the value so I can use it in a calculation in another part of the page without reloading.. What I decided to to was to create a function with the onblur= ”get_form_data()”. I don’t know what the attributte for the data of the form is. Here is a sample:
function get_form_data(){
?????
}
Anyone who can point me in the right direction with either question will have my highest respect and admiration.
|
|
|
|
|
Geoffory Simmons wrote:
"SELECT * FROM Content WHERE Contents LIKE '%search'"
Try changing the LIKE clause to
LIKE '%search%'
(I've never done this, so I don't know if it will work for you)
Geoffory Simmons wrote:
I don’t know how to do that without having to do
Why wouldn't you do that? That seems like the simplest solution to me.
Jon Sagara
"There are lies, damned lies and statistics."
-- Mark Twain.
|
|
|
|
|
var other_var = Request.Form("othervar");
if ("" == other_var || IsNULL(other_var) || [validate other form variables])
{
}
else
{
... validate data
if (!valid)
{
}
else
{
}
}
I don't use JScript, so my syntax may be a little off, but I think this gives the general idea. Anyway, this allows you to use the <form method="post">-type form for your search field.
Jon Sagara
"There are lies, damned lies and statistics."
-- Mark Twain.
|
|
|
|
|
Geoffory Simmons wrote:
.
I can't believe I didn't catch this the first time...
"action" should be set to your search page. IOW, it should look something like this:
<form name="your_form" method="post" action="searchpage.asp">
Jon Sagara
"There are lies, damned lies and statistics."
-- Mark Twain.
|
|
|
|
|
For the JavaScript issue, I assume that you have some field(s) that the user is going to enter data into and you want to take the value(s) they enter and do some work with the data and display the results in another form field on the page.
You can fetch the data from another form field on the same page by accessing the value attribute of the form field via the DOM. Like so: document.{FormName}.{FieldName}.value where FormName is the name/id of the form and FieldName is the name/id of the field you wish to access.
I would recomend doing the work you wish to do with the data in a JavaScript function and calling it when you want to update the field(s) where you want to display the results.
The function can be called using the onChange event of the form field that the user changes. This works well if you have one field that you are using to update your calculated field. For example, if you had a tip calculator you would base the value in the tip field on the tip percentage and the total cost of the bill. in this case you would use the onChange event in both the tip percentage field and the total cost field to call the function that recalculates the tip amount. Then if the user changes either field the total will be recalculated.
If the data you want to display is calculated based on several fields and you want to update the other portion of the page only when the user fills out the fields and then clicks the submit button, but you do not want to actually submit the form, you can intercept the submit button using your function and update the other part of your page instead. You can still submit the form(s) later using JavaScript as well. I have to run and so I can not give a good example of this right now, but I can detail this later if you need me to.
I can provide actual code examples of whichever method you want to use, just let me know. I have to go fix some problems at a client site right now, but I will check in later so just post in answer to this and let me know which way you want to go. Then I will post actual code examples for you.
Jason Jystad
Cito Technologies
www.citotech.net
Sonork ID 100.9918
>-------------------------------------------------<
Every program has at least one bug and can be shortened by at least one instruction -- from which, by induction, one can deduce that every program can be reduced to one instruction that doesn't work.
>-------------------------------------------------<
|
|
|
|
|
On my web page i use activex date and time picker from microsoft. To display the picker i use the code that looks like this:
<object id="DTPicker" type="application/x-oleobject"
="" classid="clsid:20DD1B9E-87C4-11D1-8BE3-0000F8754DA1" codebase="mscomct2.cab#Version=6,0,88,4" align="center" border="0" width="100" height="25">
In the body of the page i have the following function, that sets the date to desired value like this:
The problem is, that on some pc's the data picker would be displayed, and on the others pc's it wouldn't. All the pc's have the same software: NT 4.0 SP6a, IE6, the same Vesion of Date and Time Picker ocx, and the security settings of IE6 are the same an all pc's.
Any ideas how to fix the problem?
Many Thanks for any responses!
|
|
|
|
|
I have an scriplet object defined in 'createservice.aspx' using the following code
<object data="editor.aspx" type="text/x-scriplet">
Where createservice have registered and inherits from src='createservice.cs' (code Behind), this file includes funtions to insert DB written in C#.
in editor.aspx, <IFRAME> is defined where user types in texts.
and editor.aspx is linked to compose.js using<script src="compose.js?169" language="javascript"></script>
1) My question is simple but took me hours, how to retrieve mytext.value from editor.aspx and to be use in createservice.cs(code behind), say like store in a string defined in createservice.cs,
2) should I declare the object in createservice.cs, but how to declare an OBJECT, i only know how to declare htmlTeatArea, htmlLabel and etc from the UI.webcontrols class from .NET framework
Thank you very much
regards, karsin
|
|
|
|
|
Dear Friends,
I have a doubt in using split function in ASP. My prb is:
I have a string str="Technology Business Finance Music"
Now i want each word in one variable, like
a1="technology" b="Business" c="Finance" like this. I know that I have to use Split function. but i don't know how to use it. Can any1 help how to write the code for this in ASP with the same function or with any different function.
Thanx in advance
Gopi
|
|
|
|
|
Documentation on Split()
Basically, you give it a string, give it a delimiter (in your case " "), and it will return a one-dimensional array that contains each token found in the string.
Jon Sagara
"Ninety percent of baseball is mental, the other half is physical." -- Yogi Bera
|
|
|
|
|
Hi,
I have never done this, but heard this is possible:
Remove comments for actual line.
When I try this, nothing happens and the results are the dreaded X-boxes (boxes with Xs) where the image should have appeared. I also tried just to execute the DLL by running the DLL with the arguments listed -- do I just replace '?' and '%' with blanks?
The .dll and .htm file are in the same directory. What gives????
Help.
Thanks,
Johnny
|
|
|
|
|
Have you registered the DLL yet? Right-Click(while holding Shift) and click Open With... Then, press the browse button and:
if using Win 9x, go under C:\Windows\System\regsvr32.exe
if using Win2k/NT go under C:\Winnt\System32\regsvr32.exe
Then, Un-Check the "Always use this program to open this type of File" and click OK. That should register it. Now try it again. Hope this helps.
-------------------------
I love Yuzu-Chan! =P
Have u eaten ur chicken 2day?
|
|
|
|
|
Hello guys,
I recently read a question in the forum regarding a server-side program to upload a file.
I have a question from the Client side point of view.
I'm developing an application to automate the filling of a particular form. This is a program in which there is no user interface at all (i.e. browser) but just communications (tcp/ip and http).
The problem is that there is a field which is an input element of type file. As you know, the value's attribute of this element is read-only from the scripting point of view (there is no way to fill this field's value through a scripting function).
My question is, does somebody knows how to tell the server application that there is a file ready in a specific location without typing in the field manually?
In other words, there is a way to set the value of this element through a function?.
Thanks much.
A.R.
|
|
|
|
|
With file select controls, the client is supposed to send the contents of the file in the body of the HTTP request resulting from submitting the form, it doesn't just "tell that there is a file ready". See Form Submission section of the HTML 4.01 spec
|
|
|
|
|
Yes Mark, that is exactly what I need to do. Send the contents of the file in the HTTP address request, but in an automated way.
To make myself clear, let's say that I need to send my users one page after the file has been uploaded in the server, trying to "emulate" a user's keyboard typing.
I already read the Form Submission topic, and all about the element specification.
Thank you.
|
|
|
|
|
What you are asking for is specifically blocked by browsers for security reasons. Otherwise it would be easy to try and get files from users machines without them knowing.
(ex. c:\Winnt\...)
One thing you can do is have an ActiveX control loaded into the browser. Then you can use the control programactically to send the file to the server. Such a control can be easily built using Dundas Software's TCP/IP product.
|
|
|
|