|
I'm just using a HTML form. I have two CGI scripts. One that add the result to a database and the other which is a mail handler.
The basic idea is that someone fills out the form and the data is added to the database and then I get an email so I know to check.
Thanks
|
|
|
|
|
Why don't you just have the script that is doing the database insert trigger the email notification after the insert is complete?
Brian Van Beek
Inside this room, all of my dreams become realities, and some of my realities become dreams. -Willy Wonka
Just started a new blog, yeah! [^]
|
|
|
|
|
I'm with Brian. That seems to be the most logical thing. Anything you do to try and send the request to two places is going to be overly-complicated and odd to work with.
Michael Flanakin
Web Log
|
|
|
|
|
You can send the same form twíce, but then you have to send it to a different frame or window the first time. To send it the second time, you use window.setTimeout to make a javascript start after the first submit.
---
b { font-weight: normal; }
|
|
|
|
|
I believe AJAX solves this problem nicely
Search CP for AJAX...
You'll find what I used to get kicked started in AJAX
Cheers
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
Hai,
Iam developing VC 6.0 using MFC application which Selects any .MDB Database(MS-Access).
The requirement is..My Application should popup the list of Tables which contains primaryKey.
Can you pls tell me how to the retreive each table information in Access. (From MS-SQL i acheived this..using SQLGetPrimaryKeys()).....!
But this API is not Supporting For Access...
VamsiDhar.MBC
SoftwareEngineer
|
|
|
|
|
My web host has IIS setup such that the 404 error page is called error404.html and lives in the root of the web space.
In my web space I have a number of web sites, each one in a different folder (except one which is in the root):
www.eg1dotcom -> \
www.eg2dotcom -> \folder1
www.eg3dotcom -> \folder2
now if a page is not found then the browser is routed to error404.html in the root folder. This was fine while I had 1 web there. Now that I have several webs I'd like to add some javascript to the error404.html page and if the missing page comes from (say) www.eg3dotcom I would like the error404.html page to reroute to www.eg3dotcom/error404.html or aspx etc.
Any ideas or pointers to where I should look?
Thanks!
|
|
|
|
|
Not much to say. You'll have to parse the received request for the 404 and find out which site the missing page belongs to. Then, use the window.location property to forward to the correct site.
Michael Flanakin
Web Log
|
|
|
|
|
Any resources that you could refer me to where I'd find the java script syntax to do that. I'm only acquintanted with java script in browsers and haven't been fully introduced so I'm not sure how I would retrieve the value of the page which cause the 404.
|
|
|
|
|
This should be a good start: http://www.w3schools.com/js/default.asp[^]. http://www.w3schools.com[^] is a great resource.
In order to give you any more help, I'd have to know the exact URL the page receives when a 404 happens. I'm assuming you get a querystring variable that specifies the requested page that wasn't found. If not, then you're kinda SOL.
Michael Flanakin
Web Log
|
|
|
|
|
Thanks for the links Michael. No, there is no querystring variable. I was under the impression that you could pick up the referring page (the missing page that generates the 404) from a java variable?
|
|
|
|
|
I don't think it'll work because it's not a redirect. You can try it. That'd be document.referrer , using JavaScript. At least, I think that's right. I know ASP calls it HttpReferer (only one "r"). Who knows why they're different. You can try this, but I'm pretty sure it won't work. What happens is IIS looks for the file before sending the request to the page. If it's not there, then it checks to see how 404 messages should be handled. Not having the invalid URL makes it pretty much pointless, as far as I know.
Well, I guess there's only one last hope (assuming the JavaScript referrer doesn't work): does your URL change when you get redirected to the 404 page? If not, then that's your saving grace. Just grab the window.location.href property. I'm assuming it does change, but I'll keep my fingers crossed for you.
Michael Flanakin
Web Log
|
|
|
|
|
Michael: You're a genuis - a millions thanks for your help.
This works and does just what I want:
<br />
<script type="text/javascript"><br />
var lostPage = window.location.href;<br />
window.location = "http://www.xxxxxx.com/pnf.aspx?lost=" + lostPage;<br />
</script><br />
Once I'm at the aspx page it becomes much easier to process and redirect the error.
Thanks again!!
|
|
|
|
|
I'm trying to improve on this and also get the page which had the link to the missing page. I'm trying to use the history object:
document.write("window.history.length=" + window.history.length + "<br/><br/>");
etc...
Problem is I can't work out how to access element n out of the history array. I tried window.history[1] etc. but that doesn't work and the w3 schools doesn't seem to have any more info on it.
Anybody know the syntax for this?
-- modified at 0:12 Friday 30th December, 2005
|
|
|
|
|
Due to privacy issues, you cannot see the history. The only way to access this is to use the window.history.back() method. Yeah, it kind of sucks, but think about what it would mean if sites could see where you've been.
Michael Flanakin
Web Log
|
|
|
|
|
That makes sense. But I was under the impression that you could at least get to the page that linked to this one. Otherwise your log files wouldn't be able to tell you where your referrals came from right?
|
|
|
|
|
Did you try document.referrer ?
Michael Flanakin
Web Log
|
|
|
|
|
I thought I had tried document.referrer last week and couldn't get it to work but just tried it again now and it seems to work okay. Thanks again!! Problem solved and a solution found thanks to all your help
|
|
|
|
|
Not a problem. Note that you won't get a referring page if you go directly to the page. That only exists if you click a link to browse to a page.
Michael Flanakin
Web Log
|
|
|
|
|
By the way, I was kind of wrong. You should set window.location.href , not just windows.location . It's been a while :-P I think it might work either way in IE, but specifying the href property is the correct way.
Michael Flanakin
Web Log
|
|
|
|
|
Thanks Michael - I'll correct that.
Any ideas about the history object?
|
|
|
|
|
I the new one for asp and I got a problem about open file with this structure
---------- -------------- ---------------
| Client | | Web Server | | File Server |
---------- -------------- ---------------
When client click link to open file, Program get file path form database(file is in File Server)
My code use window.open(filepath). With this code it seem like client open file direct form file server and it not excatly true. How can i do to make web server get file from file server.
Thank you
-_-?????
-- modified at 5:40 Wednesday 28th December, 2005
|
|
|
|
|
Are you using ASP or ASP.NET? Either way, you'll have to create a web request on the back end to grab the file from the file server. Then, you'll have to change your content type and output the file as the response. The user will get an open/save dialog and go from there.
Michael Flanakin
Web Log
|
|
|
|
|
Thank for your advise. Can I grab file with FTP to webserver and how can i do it with "ASP".
|
|
|
|
|
Yes you can do it. The only problem that I see would be to pass user credentials. If you don't have any, then it should (theoretically) be the same as any other "screen-scrape"-style request. If it does require authentication, you'll have to check Google for a script.
http://www.google.com/search?q=asp+ftp[^]
Michael Flanakin
Web Log
|
|
|
|