Looking for proper rand/array syntax...

I'm trying to make a link take a user to one of thirty possible pages, chosen randomly.
I can imagine this is do-able via rand/array (php) but have no idea what the precise syntax would be. The various rand/array examples I've Googled do more than what I need, which is pretty basic... but I don't know PHP enough to customize myself.
Say I have a normal <a href> tag... I just want it to randomly go to one of many selected pages. Nothing more. I don't want the link name to change.
What would be the syntax for that?

This one use JavaScript and an array of links.  You could put the script in an external file if desired.
<!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=iso-8859-1" />
<title>Random Link</title>
<script type="text/javascript">
//The array. Specify links below. You can have as many as you want
var randomlinks=new Array()
randomlinks[0]="http://google.com"
randomlinks[1]="http://yahoo.com"
randomlinks[2]="http://dynamicdrive.com"
randomlinks[3]="http://cnn.com"
randomlinks[4]="http://msn.com"
randomlinks[5]="http://bing.com"
randomlinks[6]="http://youtube.com"
function randomlink(){
window.location=randomlinks[Math.floor(Math.random()*randomlinks.length)]
//-->
</script>
</head>
<body>
<a href="javascript:randomlink()">Random Link</a>
</body>
</html>
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media  Specialists
http://alt-web.com/
http://twitter.com/altweb

Similar Messages

  • Looking for proper SIM card for applet development

    Hi,
    I would like to develop some applet on the SIM card. And does anyone know where I can get the proper SIM card?
    I have a bit search for test SIM card and blank SIM card, but I am not sure which one can be used for applet development. It seems that Gemalto provides some development suit that includes some sample cards. But the suit is too expensive and maybe I don't need the tools they provide. I don't want to buy the wrong one, so it would be very helpful if any of you has some provider information or links!!
    Thanks in advance!!
    regards,

    934624 wrote:
    I would like to develop some applet on the SIM card. And does anyone know where I can get the proper SIM card?You should over the internet and should contact different vendors. There are many Chinese companies which can provide you sample cards.
    I have a bit search for test SIM card and blank SIM card, but I am not sure which one can be used for applet development. Any Java SIM card can be used for applet development.
    maybe I don't need the tools they provide. You do as you will need a tool to install your applet on the SIM card
    I don't want to buy the wrong one, so it would be very helpful if any of you has some provider information or links!!Are you just want to write applications or wanna be able to install them too on real cards ? If the purpose is just writing of apps then oracle and ETSI have provided everything, you don't need to buy any additional tool. But yes for dubuging you will need some third party tool or write your own one : -)

  • Looking for a particular vlaue in a id array

    i have a program which generates me 1000000 sample values ie a array of 1 million values.in this 0ne million values i need to look for a particular range of values ie allthe values in the array are 4 and then they ia a value like say 10 and some more values. i need to detect the values greeater than four and then take the 20 values from the index where it is detected. i may have hundered of this pattern in the million samples.

    I am attaching a VI which does what you want. The diagram is pretty straight-forward. Let me know if you don't understand anything.
    Regards,
    Khalid
    Attachments:
    chkarray.vi ‏34 KB

  • Looking for Thunderbolt 2 RAID Array options that can match the new Mac Pro's quietness -- or at least come close!

    Maybe it is too early to talk about anything beyond the Pegasus2 Series (http://www.promise.com/promotion_page/promotion_page.aspx?region=en-global&rsn=1 00) when it comes to Tunderbolt 2 storage options. Looking for something on the order of 8 to 12 usable TB of redundant storage or possibly a JBOD option of 4 bays. This is coming close but I do not think it is Thunderbolt 2 (http://www.g-technology.com/products/g-raid-thunderbolt).
    Either way -- looking for users experience not only on usable Thunderbolt 2 solutions but more importantly noisiness. I want to upgrade my existing Mac Pro to one of the new ones and I have found the old one to be nearly unnoticable in a quiet desktop environment. Would love to find the same peace and quiet when migrating to the new form factor that is going to need external storage to match what I have been used to inside the old Mac Pro.

    Not your quiet storage, but then I would put it in a cool closet or small room off to the side :-)
    http://www.macgurus.com/store/Item/ARC8050 ( I was assuming but maybe not, that it would support RAID6 which is always preferable for larger arrays. Seems to have most features you want for 8 drives). MacGurus "Burly" are never quiet but they are rugged and well tested.
    Migrating storage will be a concern. I don't like the noise from my older SATA OWC dual-drive metal enclosure though suppose to be 'acceptable' unless they have improved the fans they are out for me.
    OWC for Thunderbolt products.
    Helios enclosure (the new dual-slot Helios PCIe chassis)
    … moving various hard drives into Thunderbolt cases
    USB3 hard drive enclosure.
    For those without eSATA enclosures, a simple eSATA to USB3 adapter might do the trick.
    USB3 is plenty fast to house two hard drives.
    OWC Mercury Elite Pro Dual.
    Available now starting at about $430.
    review of the OWC Mercury Elite Pro Dual.
    Some upcoming new TB2 enclosures:
    http://www.sonnettech.com/product/thunderbolt/index.html
    http://gigaom.com/2013/12/21/the-technology-gap-between-the-old-and-new-mac-pro- could-cost-you-a-mini/

  • Looking for good sound module/card for AE CS4 and AE CS5.5 Echo Audio not working proper

    Hi,
    I have two different computers, one with AE CS4 and a other one with AE CS 5.5.
    On both systems ( Windows 7 64) my Echo audio fire4 sound-module driver is not working proper
    and crashing AE. Despite the latest updates from Echo. When I uninstall the driver the problems
    are gone!
    That's the reason I'm looking for a good stable sound-module (FireWire) to work with Premiere Pro
    and AE.
    Thanks! David

    Hi,
    I have two different computers, one with AE CS4 and a other one with AE CS 5.5.
    On both systems ( Windows 7 64) my Echo audio fire4 sound-module driver is not working proper
    and crashing AE. Despite the latest updates from Echo. When I uninstall the driver the problems
    are gone!
    That's the reason I'm looking for a good stable sound-module (FireWire) to work with Premiere Pro
    and AE.
    Thanks! David

  • Looking for simple algor. for merging two arrays

    Do anyone have a simple algorithm for merging two arrays where both arrays can be null or length=0

    class Merger
         private int[] arr;
         public Merger(int[] pa, int[] pb) {
              arr = new int[pa.length + pb.length];
              for (int x=0; x < pa.length; x++) {
                   arr[x] = pa[x];
              for (int x=0; x < pb.length; x++) {
                   arr[x+pa.length] = pb[x];
         public int[] getArray() {
              return arr;
    public class MergeMaker
         public static void main(String[] args) {
              int[] a = { 1, 2, 3 };
              int[] b = { 7, 8, 9 };
              Merger m = new Merger(a, b);
              int[] c = m.getArray();
              for (int x=0; x < c.length; x++) {
                   System.out.println(c[x]);
    }Mark

  • Looking for a proper guide on creating services

    Hi,
    We're looking into creating our own Enterprise Services using all the capabilities of PI 7.1 and our ERP system (ECC 6.03) . When we create services now we basically create our flow in PI and then expose the start of it as a Service, so you can start it from anywhere (we've mostly done this in Composite Applications and with Adobe Interactive Forms).
    I'm looking for a how-to guide to create your own ES from scratch. Using the official building blocks provided in SAP (instead of creating our own data types) and the creating the proxies, and exposing those as a service.
    We're thinking about a flow to retrieve certain information from the ERP, starting and ending in a Service.
    I've looked through the documentation availible here, skimmed through all the TechEd 08 presentations and exercises but haven't found anything that covers creating a new service. I have however found extensive information on enhancing one, though this is not what I'm looking for.
    Any help would be greatly appreciated,
    Cheers,
    Frederik-Jan

    Hi Frederick,
    You cah check the following links for the step by step creation of web services hope  they are helpful to you in proceeding
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50b63e8f-a4bb-2a10-e9b1-ba803fd06739
      https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0f3cf81-e6da-2a10-6891-ef321fdc1a6b
        http://help.sap.com/saphelp_nw70/helpdata/en/44/b7f7e1354135e7e10000000a1553f7/frameset.htm
    Webinar on creating webservice in ABAP environment..
      https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_media&query=creating+webservices&adv=false&sortby=cm_rnd_rankvalue#
    Thanks,
    Ram.

  • Looking for a Trade Show app

    Was at a trade show back in November 2010 and saw someone using the iPad to take down customer information and send their contact info, not having an iPad at the time i didn't think to ask what the app was called.
    I'm looking for an app that will allow prospects to input their contact information and possible check a few boxes of products they would be interested in, once they hit submit it would then send me and email with their information and a thank you email for signing up with my contact information included in it sent to their email. Does anyone know of an app that would allow me to do this?
    Matt

    I don't know of any existing Apps, but it sounds more like something a simple web-based HTML form would be more than suitable for. As long as the iPad has a net connection (which it would need to have to send an email) you just host the web-page on your companies web-site and view it in Safari on the iPad.
    You can even make it look like a proper app by hiding the Safari toolbars and saving it as a web-app.
    This is something someone with moderate web development skills could put together and customise it to look as you want and contain whatever checkboxes, form fields you want.
    Here's Apple's information on creating web-pages optimised for iPad/iPhone Safari:
    http://developer.apple.com/library/safari/#documentation/appleapplications/refer ence/safariwebcontent/OptimizingforSafarioniPhone/OptimizingforSafarioniPhone.ht ml
    You could also use a pre-built library such as:
    http://www.jqtouch.com/
    http://jquerymobile.com/
    http://www.sencha.com/products/touch/

  • Adobe creative cloud has stopped working, all my individual programmes from adobe open and work fine, but when I try to open adobe cloud it starts to open then says adobe cloud has stopped working, looking for a solution then shuts down, I can not open it

    Adobe creative cloud has stopped working, all my individual programmes from adobe open and work fine, but when I try to open adobe cloud it starts to open then says adobe cloud has stopped working, looking for a solution then shuts down, I can not open it at all.

    Without proper system information and the application logs nobody can tell you much.
    Troubleshoot Creative Cloud download and install issues
    Mylenium

  • What is Finder looking for? How can I make it stop?

    I've just repaired permissions w/ Disk Utility and run MacJanitor (three times) and restarted. Finder cannot open any files, including my two mounted drives. Although I'm often connected to my antique OS9 PB3400, it was off at the time.
    Now when I attempt to open anything Finder tries (sometimes it's a completely blank window) to give me a server login with the admin user's name filed in, asking for the password to connect as a Registered User to server 'KT iMac' (never heard of it).
    Canceling, trying to connect as Guest or using one of my three passwords—I'm one of those securityphobes—produces the same result. Beachball of Death. Repeated Finder relaunches/Force quits w/ ActivityMonitor are fruitless, unless the occasional "Finder hung, application not responding" message is progress. Still can't open.
    Applications appear unaffected, except when they expect Finder to do something for them. Ironically, the Find function works OK, but trying to use it as a backdoor to open a folder further up the hierarchy just gets the login futility going.
    Seems to me that somewhere Finder's getting info from some file or cache that tells it a connection to this mythical server's required for proper functioning. I've nothing showing in Recent Servers—cleared that list—where else might I look? Or am I out-to-lunch on this?
    If it's relevant, MacJanitor finishes its All Tasks run w/ a report that begins:
    Rebuilding whatis database:
    find: /usr/local/man: No such file or directory
    makewhatis: /usr/share/man/man3/DHparams_print.3ssl: No such file or directory
    makewhatis: /usr/share/man/man3/DHparamsprintfp.3ssl: No such file or directory
    makewhatis: /usr/share/man/man3/DSAparams_print.3ssl: No such file or directory
    makewhatis: /usr/share/man/man3/DSAparamsprintfp.3ssl: No such file or directory
    … and runs in similar fashion for a dozen or so more lines.
    Any help or insight of any sort would be much appreciated. I'm even willing to brave Terminal.

    Thanks for the reply Fifth. Console's all new to me, and the list of logs in the Sidebar seems impenetrable computerese, but if I click on Console log, I get:
    Mac OS X Version 10.3.9 (Build 7W98)
    2007-06-01 09:41:17 -0400
    ===========================================================
    09:41:18: INIT FinderPop-20006 (built Jan 21 2007 10:49:46)
    ===========================================================
    FinderPop-20006: Patching 'Finder' 0:a0001 (CF)
    DOCK: CFMessagePortSendRequest returned -2
    FinderPop-20006: Patching 'Finder' 0:2a0001 (CF)
    FinderPop-20006: Patching 'Finder' 0:2c0001 (CF)
    FinderPop-20006: Patching 'Finder' 0:2e0001 (CF)
    … after a restart and a couple of attempted file opening/Finder relaunches. Am I looking in the right log?
    FinderPop is working perfectly, BTW, right up to the handoff when it wants Finder to actually open the file I've navigated to. At that point the 'ghost server's' login window or the blank therof appears along with the BoD.

  • Looking for a solution to simply drop outliers

    I have created an application to measure a Helium concentration, using an Alcatel ASM-102 Leak Detector.  The problem is that occasionally, the device sends out a bogus value, perhaps 0.00x10^0 or perhaps 2 x 10^-2, reather than 2 x 10^-7.  I am looking for the cleanest approach to look at the array when I'm done, and just discard any values that do not fall between 1 x 10^-6 and 1x10^-3.  Any ideas? 

    altenbach, as usual, your programming is really easy to follow.  OK, so here is the last piece of the puzzle.  I actually have two arrays:  one is a helium concentration, and the other is a helium flow. My flow values are always good, but as I said before, there are sometimes bad values in the concentrration array.  SO, what I want to do is to eliminate the flow element that corresponds to any bad concentration element.  Hmmm, sounded like a good idea when I did it   Anyway, you can see that the result that I currently have is that the filtered flow array is simply the last n elements of the raw flow array, n being equal to the delta between the array size of the raw concentration and the filtered concentration arrays.  I hope I haven't managed to confuse you with that nonsense. 
    Basically, if I drop 5 elements from the raw concentration array, due to their not having passed through the filter, then I show the last 5 flow values in the filtered flow array, rather than passing all but 5 of the values.
    If 15 of 20 helium concentration values are good, then I pass the last 5 helium flow values, rather than the 15 values that correspond to the 15 good concentration values.
    HELP!  If I can't figure this out, I may just take the average of the good concentration values, and the average of all the flow values, and do the rest of my calculations based on averages, rather than calculating each value based on a known good concentration and a known good flow. 
    Attachments:
    Remove Outliers dual sub.vi ‏50 KB

  • New window manager (with prototype!) [wmii-like] --- looking for help

    I have a prototype for a new window manager in the style of wmii. It is called
    cakewm. I currently have a prototype version implemented in pygame, and would
    like help moving this to use X---making it a real window manager.
    Disclaimer: I have a very limited knowledge of X11 and window manager
    development. The most I've done is add a couple new features to wmfs.
    To get the code
    > git clone git://github.com/saikobee/cakewm.git
    Then run main.py. cakewm depends on pygame.
    Upon running, press Alt-Enter to fullscreen cakewm and intercept keybinds, or
    Alt-Space to just intercept keybinds.  Press Alt-Esc to quit. The window
    manager related keybinds are listed in the file binds.conf.
    Config note: <WSCA-x> means Windows-Shift-Control-Alt-x
    Implementation note: pypixel.py is a large and mostly useless dependency. I
    forked a library I made previously rather than coding straight in pygame.
    cakewm's goals are to be similar to wmii, but with more functionality, easier
    configurability, and saner defaults.
    - cakewm is fully functional using the keyboard. Mouse support can come later.
    - cakewm provides 9 workspaces per monitor.
    - cakewm manages each workspace as a group of columns. Each column is like a
      wmii default split, except each window can have other windows "stacked" on
      top of or behind it.
    - cakewm manages column sizes (and window sizes within columns) using a
      master/slave paradigm, with the ability to adjust the size ratios.
    - cakewm's configuration file is simple key=val pairs, with the ability to
      include other files like in C.
    - cakewm has a slightly larger emphasis on window decorations (adjustable
      size---even in tiled mode) and themes (nothing bloated, like pixmaps or
      gradients---it's all still simple colors).
    - cakewm will have proper support for international text (Japanese text in
      window titles or the wmii status bar generally render as boxes) through the
      use of a more advanced text library such as Pango.
    Please let me know if you have comments, questions, or concerns. If you are
    interested in helping, get in touch with me. If you know somewhere better to
    look for volunteers, please let me know.

    m4co wrote:
    Wow is this forum active. Makes me feel welcome here
    The thing about wireless, I actually like command line, but there are a few things that are worth having a applet or something.
    And wireless is one of those. I guess I can take a look on wicd.
    It's a good idea to have compiz as the WM actually. Would it be lightweight to have it like that?
    Is there anybody here that uses compiz as a WM?
    For the xfce4-panel, is it possible to get transparency on it? That's probably the only thing holding me back with xfce4-panel.
    If "able to run compiz" wasn't a requisite, what other WM would you suggest for my "profile" ?
    I would like to hear other users opinions who like to customize everything on a WM.
    I recommend running Compiz by itself. There is a good wiki page on it in the Arch wiki. Some apps you'll want to go with it are:
    LXAppearance --change GTK/icon theme
    Feh or Nitrogen --Set Wallpaper
    Xfce4-panel --The lightest one that works with Compiz properly
    Or, if you don't want a panel: stalonetray
    Compiz-deskmenu --For a customizable right-click main menu
    Gmrun --Run dialog (Alt+F2 in most DEs)
    And this helped me a lot.
    Thank you all for the replies. I appreciate.
    Xfce4-panel can have transparency.  The only problem is that everything become transparent: text, icons, everything.
    I use Compiz as a standalone WM and it is much lighter than DE+Compiz. My Compiz setup uses about 30MB(out of 1GB) more RAM than my Openbox setup (which are both the same except for the WM).

  • Delivery analysis / Looking for a BEx solution

    Hello everybody,
    I'm looking for an easy solution within the BEx. I would like (if possible) to avoid touching the data model.
    Here what I would like to achieve:
    Description of my desired report: delivery analysis ( number (quantity) ofdeliveries with X positions ).
    Output should look like this:
                                number (quantity) ofdeliveries with X positions        
    Country              X=1        X=2      X=3    X=4    X=5   X=6   X=7   X=8   X=9    X= more than 10 
    FR                        1451   407   377 and so on
    ES                        177     40    24   and so on
    IT                          173     66    44   and so on
    For me its quite tricky. In my Cube (Multiprovider) there should be all information included.
    I have country, delivery (itself) , number of deliveries, number of delivery positions )
    How can I do that. Maybe with new calculated figure and a condition. Any ideas?
    Hope to hear from you.
    Best regards Harry

    steffi.kono wrote:
    In this example I have four arrays, which I would like to save alltogether in one file. First column should consists of time stamps, second column of value type 1, third column of value type 2, ... How can I solve this?
    Built the 4 1D arrays into a 2D array, the use write to spreadsheet file.
    steffi.kono wrote:
    And, after that, how can I display only the second coulmn (e.g.) and time stamps in a waveform chart from this file? Or how can I say in LabVIEW: "display the last 30 values of column three over the time in a waveform chart"?
    There is "array subset", which allows you to get any desired subset from an array. If yoyu want entire rows or colums, use "index array".
    To display the last 30 values in a chart, just feed the data to a chart with the history size set to 30 elements. The rest will fall into place.
    LabVIEW Champion . Do more with less code and in less time .

  • Looking for a replacement m2010us hard drive adapter

    Hello all,
    I have a mostly intact Compaq m2010us, sans HDD caddy/adapter. I searched a little online, and found a few different adapters being described as the proper one. Is there still a way to purchase one through HP or equivelent source? Just trying to fix and polish this up and donate it to a student in need. 
    Thank you,
    -J

    Seagate is recommended due to the 5 year warranty, though other manufacturer's are good and work well and usually offers 3 year warranties. As was said above, any SATA drive will work, whether it's 150 or 300, though the laptop only will run at 150 speed.
    I recommend getting a 7200rpm drive with as much cache as possible. A lot of newer drives are offering 16MB caches which show a strong lead in performance over other 7200rpm drives.
    For instance:
    * The Seagate ST9200420AS (200GB, 7200 rpm, 16MB, SATA 300, 5 yr warranty)
    * The Hitachi Travelstar 7k200 (200GM, 7200 rpm, 16MB, SATA 150, 3 yr warranty)
    The difference between these two is the SATA version, with the Seagate running a faster version of SATA which will not be taken advantage of by the MacBook, however future models or purchases by you may in fact use SATA 300 so it may be a good purchase if you plan to swap it during future upgrades. Further the 5 year warranty over 3 years is nice.
    The recommendations above are if you're looking for a lot of storage with maximum performance. If you simply want a large drive with average or stock performance consider the HITACHI Travelstar 5K250 (250GB).

  • Looking for a pager with advanced functionalities

    Hello everyone,
    I am looking for a pager with which I could put custom icons for the different workspaces.
    I have an HTPC that is mainly used for three things: watching movies, playing music and browsing the internet. Therefore, I would like to have four workspaces, one for each of these and another one for administration. Since this is an HTPC, I'd like it to look good and I think it would be neat to have images instead of numbers/squares for the workspaces: a movie reel for the "movies" workspace, a note for "music", etc... I have been looking at pagers on the wiki, but most of the links are broken. I am currently running XFCE, but would install another WM for this. The idea came to me because I could do this on awesome 3, which is installed on my laptop, but my roommates are firmly opposed to a tiling WM on the HTPC.
    If anybody can provide suggestions, they will be very welcome.
    Cheers,
    François

    Howdy-ha- flamirande.  I don't want to be a total prick, as it's not my place; it's yours.  Xfwm or Awesome will get the job done, won't it?  You might be able to wow them if you get a universal remote and set up a proper lirc connection, letting them sit on the couch and have the power at the press of a finger.  I have some friends with XBMC (the real thing--a dedicated, old-school Xbox hacked with BSD for all their media),  and they're more satisfied with the results it provides than how it looks.  Yeah, their Win and Mac PCs (both my friends' and your roomates') give them Facebook and YouTube, but yours gives them music, movies and tv and internet on demand, at a smaller resource cost and with a more versatile core and interface.  If they're so touchy about polish, let them figure it out.  I'm not just saying this as the sorry excuse for a computer geek that I am, but also as a person who's been dealing with many roommates for roughly a decade. I mean I don't know your situation but what do they think, the setup you give 'em is supposed to get them attention?
    If these folks can't be satisfied by the fact that your system can provide them with a reliable, versatile, centralized, kick-ass setup that theirs can't, well...
    More constructively: If they just won't have it...maybe openbox and tint2?  You've got a low ram and cpu demand there, keeping music from skipping and video from tearing, if you work it out properly.  Openbox has always been my choice for the right balance between polish and minimalism.

Maybe you are looking for

  • Display image in tabnavigator with rollover effect

    Hi I need to create a tabbar with image in tabButton which should have mouseOver and mouseOut effects. Thanks and warm regards, varun

  • Cannot Edit Captions in One File

    Hello,      I'm using Captivate 3, and I have this one project file that I cannot edit the captions in. I wasn't having this problem until I imported a slide from another project. Ever since the slide imported, I haven't been able to edit the text ca

  • HT4097 how to restore ipad without updating

    hi.i tried to update my ipad' ios some few days ago but due to slow internet connection my ipad could not finsh updating. now i want to quit the update so i can use the ipad but i cannot restore under itunes without updating. any help from anyone who

  • Says my computer does not support video conferencing?

    Just recently whenever i tried to do video chats it tells me my computer does not support video conferencing? How can i fix this?

  • Firefox crashes 30 seconds after being opened

    I have The OS 10.5.8. Firefox is The OS is 10.6.8. and says it is up to date. In the past few days the browsree crashes after about 30 seconds to one minute of being opened. below are the crash IDs: Crash ID: bp-d17bafb4-5ae1-4bd3-b4a0-22c242131212 C