|
have you tried looking in hotscripts.com?
Chris J
www.redash.org
|
|
|
|
|
|
This is foxing me a little and I wonder if someone could point me in the right direction please or include what is needed to resolve this.
My page at the moment only includes the following and the address(URL) is given as the example.
<?php
$url = $_SERVER['REQUEST_URI'];
echo $url;
?>
The return is...
/jh6k95/index.php
However the only thing I want from that is...
jh6k95
So, I suppose the question is how do I strip out folder name.
Many thanks in advance for any help.
Ray
|
|
|
|
|
There are several ways to do it, so these are the most simple options that I can think of.
1. Use dirname[^] to get the parent directory name (if you are sure that the URL always contains the filename):
<?php
$url = $_SERVER['REQUEST_URI'];
$dir = trim(dirname($url), '/');
2. Use explode[^] to break the path into an array:
<?php
$url = $_SERVER['REQUEST_URI'];
$parts = explode('/', trim($url, '/'));
$dir = $parts[0];
I've used trim[^] in both of these to remove leading and trailing '/' characters.
|
|
|
|
|
Thank You Graham,
The first one only gives me \ for some reason but the question is answered with the second one you gave.
Many Thanks
Regards
Ray
|
|
|
|
|
Hello all,
I'm trying to keep the page still... without luck...
In one of the pages I'm making I have a list of divs that are giving an effect of rows in a listctrl... you know one is gray, the next one white, the third gray again and so on...
In each of those rows there is a link that allows me to show/hide a form that is at the bottom of each div (I'm using some code like this one[^]).
If the complete page doesn't fit into the explorer window, each time that I press that link the page moves to the top giving the user a strange feeling as the user has to search again the content that needs in the page...
How could I maintain it at the same position?
Thank you in advance!
|
|
|
|
|
One simple solution to this problem would be to focus on an anchor (<a> tag) or one of the form fields that you're dynamically showing, e.g.:
function focusOn(elementId) {
getElementById(elementId).focus();
}
I assume this is required because the page must be reloaded when you're showing the form controls? A better solution may be to just have them on the page all the time, but using the
display:none CSS style, and then set the one you want to be visible.
Hope this helps!
Cheers!
|
|
|
|
|
Hello all_in_flames (I hope you are well ),
I've tried the first option about the <a> tag... this semi-works as the page gets moved as before but a little bit better as it shows the content centered...
Also tried to use focus()... without luck... it seems it don't work for me...
function toggle(id)
{
var e = document.getElementById(id);
if(e.style.display == 'block')
{
e.style.display = 'none';
e.focus();
}
else
{
e.style.display = 'block';
e.focus();
}
}
then arriving at your last recommendation... I think it is how I'm doing it right now... I've put all the content there but the style is display:none and I "only" show and hide it... This has been my initial approach and the behavior is not what I want...
Any idea on what should I do?
Thank you in advance!
|
|
|
|
|
There are only a small subset of HTML elements that can accept focus. I believe all of the input fields (text boxes, check and radio boxes, etc) and anchor tags are able to accept a focus() call. I would pass the id of an element that can be focused on as well as the id of the element to be shown/hidden:
function toggle(toggleId, focusId)
{
var e = document.getElementById(toggleId);
var f = document.getElementById(focusId);
if(e.style.display == 'block')
{
e.style.display = 'none';
f.focus();
}
else
{
e.style.display = 'block';
f.focus();
}
}
Good luck!
|
|
|
|
|
OK, now I've put the focus on the first editbox in the form...
I'm seeing another problem here... and I think I'm trying to solve it in the wrong way:
In order to allow the user to click somewhere to toggle the form on/off I've put a link.
That link links to # (href="#") this seems to be the cause of my problems as if I remove that (href="#") then the page doesn't moves.
The only problem here is that it also shows the link as plain text (black + no hovering effects) so the user won't notice it as a link...
How would you proceed in that case?
Thank you for your time!
|
|
|
|
|
Already solved...
Nice suggestion to use focus on the desired control, but it did not make it... Anyway returning false after the function worked...
See Graham Breach[^] answer[^].
Thank you again for your time and feedback!
|
|
|
|
|
It is not a floating div... Not at least if you are speaking about the "float" style.
Anyway I've searched for the overflow parameter and I've seen that it is used to show scrollbars...
Thank you for your feedback.
|
|
|
|
|
Already solved Richard,
Graham Breach[^] has saved me!
The way to do it was to return a false... See his answer[^].
thank you for your time and help!
|
|
|
|
|
Make sure that your click handler returns false:
<a href="#" onclick="function();return false">Link</a>
or
<a href="#" onclick="return function();">Link</a>
if function() returns false.
|
|
|
|
|
Definitely Graham... there should be a button with more "o" as in "Goooo...oooood answer".
This was one of those things that can't be searched in the internet (not at least with my google-fu).
a big THANK YOU!
|
|
|
|
|
|
hello guys... I dont know where to put this question. Lets say I have made a notepad in C#.NET. Now how can I run that notepad on linux platform? thnx
|
|
|
|
|
Have you looked into Mono[^] yet?
Mono is .Net for Linux but I believe it's limited to .Net 2.0.
Developing Mono (.Net) for Linux can be done with a Visual Studio plugin for Windows or MonoDevelop which also runs in Linux.
|
|
|
|
|
Mono can run .NET 4 applications under Linux, even without recompiling.
Bastard Programmer from Hell
|
|
|
|
|
I think you can run it on the Linux. Because Linux is also an operating system. It allows the application to run the compatible software.
Website Templates | Joomla Templates
modified on Thursday, July 14, 2011 1:36 AM
|
|
|
|
|
its better u do in windows platform because on linux it wont run fully and still u want to then there are some linux which provid a good form of .net eg.suse
|
|
|
|
|
You need install Mono on Linux. If your .NET app using .NET 2.0, you can run you app on Linux. I'm using Ubuntu 11.04 and run KeePass 2.15, a .NET open source. Just exit to terminal and type "mono KeePass.exe"
Using MonoDevelop, you can develop a C# application on Ubuntu.
Also, you can run ASP.Net and C# on Ubuntu too.
http://www.vn-software.com/
|
|
|
|
|
If you want to just run it you can do this without problems if it is that simple and written in .NET 2.0 because wine(the emulator for windows apps) can handle it. But if you want to develop, Mono is the answer. Latest versions are quite good..
|
|
|
|
|
Riceto wrote: is that simple and written in .NET 2.0
You obviously haven't used it yet. Support goes beyond .NET 2.0[^], and it's quite capable.
Bastard Programmer from Hell
|
|
|
|
|
While most of ms .net is working and implemented in mono (expect a lot of winforms and wpf) you are pretty safe with server side code, as for UI code except for rudimentary winforms, you will be looking at a major porting project.
While the plug has been pulled by Novel, Miguel De Icaza has created a spin-off company to keep mono running.
Like most ports you will be looking at a significant porting operation I'm afraid.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
|
|
|
|