Another PHP Question

Whats the best way to return someone to the page they came
from using a header redirect in php.
I have a script that process a form that is present on
multiple pages. After the form is submitted I would like to return
the user to the page the form was submitted from.
I have read using $_SERVER['HTTP_REFERER'] is not the
greatest... Even if I were to use this method I would still need a
way to remove any query string from the base url.
Can anyone offer some advice? Whats the best way to
accomplish something of this nature?
Thanks in advance!
J

Sorry for the dupe

Similar Messages

  • Another newb question: multiple virtual servers

    Hi, I have yet another ignorant question. I have several unrelated web projects that I am working on, and I would like to be able to set up a virtual server for each one for testing purposes, such as: http://project1, http://project2, http://project3. Can someone tell me if this is doable, and if there are any tutorials/resources on this for someone who has 0 experience running a web serer? Sorry for being so ignorant!

    Yes, it is doable.
    You can setup virtual server either by IP or by name.
    If you have one IP, and want to set them up by name (ex. http://project1, http://project2, http://project3) you can do so easily with this type of configuration:
    <virtual-server>
        <name>mydomain</name>
        <http-listener-name>http-listener-1</http-listener-name>
        <host>*.mydomain.com</host>
        <document-root>/www/domain</document-root>
      </virtual-server>
      <virtual-server>
        <name>myotherdomain</name>
        <http-listener-name>http-listener-1</http-listener-name>
        <host>*.myotherdomain.com</host>
        <document-root>/www/myotherdomain</document-root>
      </virtual-server>
    ....The important part here is that
    a) all virtual servers share the same HTTP listener
    b) which virtual server serves the request depends on the $HOST request header send by the client. Sun Web Server does the matching for you. It will match $HOST vs. the virtual server's host attribute. Depending on which site you connect to the right virtual server will be used.
    c) if the $HOST request header does not match any of the virtual servers, then the default virtual server defined in the HTTP listener will be used.
    To create a virtual server, use the Admin GUI, access the configuration, and then add new virtual server. Or use the following CLI command.
    wadm> create-virtual-server --config=myconfig --http-listener-name=http-listener-1 --document-root=/www/docs/myserver.com --host-pattern=myserver.com --log-file=../logs/myserver.com-error_logs myserverHost pattern will be used for matching. Some of this elements might be optional.
    Hope that helps. And keep the questions coming :D
    Edit: Also check the documentation
    Using Virtual Servers in SJS Web Server 7.0

  • Another simple questions

    Hello friends:
    Another simple question: I need to learn things about Oracle on my desktop.
    My machine runs Windows 98. Oracle has some desktop product of its Database Line?
    For example: Oracle Personal?
    And Oracle Lite? What's the main difference between Oracle Personal and
    Oracle Lite?
    Thank You
    Gracias
    Ing. Pablo Romero
    CORDOBA ARGENTINA

    1. I didn't know the answer to your first question, but I googled it and it says the item is the in-call audio boost.
    http://forums.crackberry.com/f71/flag-icon-47659/
    2. isn't this setting determined by the carrier? So it's not a setting in the phone, but when you call in to your voicemail you can change your options?

  • PHP question related to preg_match_all since PHP 5.4 [SOLVED]

    Please let me know if a PHP syntax related question is not appropiate here. I am debugging an abandoned PHP 5.2.3 script from: http://outbreakmonkey.org/mythtv/csr0.3.php
    This is the part of the code with the problem. I believe preg_match_all has an issue with PHP 5.6.
    $cutlist=file("$recordingdir/$txtfile");
    #Markssql will hold the lines of SQL to insert in to the DB.
    $marks=array();
    #Go through each line
    foreach ($cutlist as $aline) {
    #And match "One or more digit followed by one or more space/tab folowed by one or more digits again"
    #ie. Look for two columns of numbers - get those numbers.
    preg_match_all('/^([0-9]+)\s+([0-9]+)/',$aline,$result);
    #if there numbers make sense, create some SQL to insert the record in to the database
    if(!empty($result[1])) {
    if (($result[1][0]>0)&&($result[2][0])>1) {
    $marks[$result[1][0]]=MARK_COMM_START;
    $marks[$result[2][0]]=MARK_COMM_END;
    return($marks);
    with a sample $cutlist being:
    FILE PROCESSING COMPLETE 99042 FRAMES AT 2500
    27475 32467
    52725 58360
    86124 89494
    96382 99042
    The script works with PHP 5.6 but returns an output of 0 for these marks. PHP says the following in the change log:
    Changelog
    Version Description
    5.4.0 The matches parameter became optional.
    5.3.6 Returns FALSE if offset is higher than subject length.
    5.2.2 Named subpatterns now accept the syntax (?<name>) and (?'name') as well as (?P<name>). Previous versions accepted only (?P<name>).
    Does anyone good with PHP know how the syntax of preg_match_all could be changed to work with 5.6? Or maybe another function to do the same?
    Thanks.
    Last edited by wdirksen (2014-10-02 19:33:55)

    Thanks mpan for your reply.
    This is not a matter of strict debugging per se. This PHP script has worked for many in the past. Also the provided cutlist is a complete one and not a snippit. There is more online about preg_match_all and PHP regressions so I was hoping someone whould know an easy way out here. I don't think it has to do with foreach. I will try to track this down and learn from it, starting with trying an older PHP version with current ARCH and hoping it will not fyrk up other PHP stuff like mythweb.
    Yeah. You're right about the Programming and Scripting. I didn't scroll down far enough I guess.

  • ANOTHER formats question...

    I've been using Streamclip to convert mpeg2's to Quicktime. I've experimented with Apple MPEG4 and Sorenson 3. Not the jpeg format so much.
    My question: which is the best format for keeping the file size about the same and losing the least video quality? These files are for multiple purposes. Some will be used on the internet and others will find their way onto dvds.
    Is the option from streamclip to DV good for Final Cut and Quicktime?
    I realize the short answer to my question is that it totally depends on what I want the file for. But what I'm really looking for is a primer on the diff between Sorenson, MP4, JPEG-A(B)....etc.
    I'm moving toward using h.264 for everything, but not everyone has qt7 - you know?

    My question: which is the best format for keeping the file size about the same and losing the least video quality? These files are for multiple purposes. Some will be used on the internet and others will find their way onto dvds.
    Everybody has their own picks. However, you might also want to consider the fact that not everybody has upgraded to latest QuickTime Player.
    My general pick would be Sorenson Video 3 for general purposes. Sorenson Video 3 performed better (in terms of quality) then MPEG 4 when you limit the bitrate to some small number (i.e. small filesize). As for DVDs, you might want to export in another format for it.
    Is the option from streamclip to DV good for Final Cut and Quicktime?
    It is, assume the original file is good quality.
    But what I'm really looking for is a primer on the diff between Sorenson, MP4, JPEG-A(B)....etc.
    I made this page awhile back, you might find it useful.
    http://mac.sillydog.org/qt/compare.php
    Hope this helps.
    <small>disclaimer: I am not selling any products, but there are Google Ads in that page.</small>

  • Populating an array of objects with a loop. Noob PHP question.

    Hey guys,
       You are all such a great help! Here is another one for you, the simple code below should create an array of pizza objects (and it does) then display each object in order. However... for some reason each object in the array seems to inherit the properties of whatever the last object entered was.
    This code:
    <!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=utf-8" />
    <title>Untitled Document</title>
    </head>
    <?php
    class pizza{
              public $price;
              public $description;
              public $name;
    $menu2=fopen("pizzaMenu2.txt","r") or exit("System Error!");
    $pizzas = array();
    $arraypos=0;
    //This loop does all of the READING and populating of variables
    while(!feof($menu2))
                //First get the array position
                                  $arraypos = (int)fgets($menu2);
              //Then Put in Title in title2 array
                                  $pizzas[$arraypos2] = new pizza(0,0,0);
                                  $pizzas[$arraypos2]->title = fgets($menu2);
                                  $pizzas[$arraypos2]->description = fgets($menu2);
                                  $pizzas[$arraypos2]->price = fgets($menu2);
      } //End of reading loop
    //begin writing data
    $arraypos=1;
    while ($arraypos <=3){
              echo "the array is in position: ".$arraypos;
              echo "<br />";
              echo $pizzas[$arraypos2]->title;
              echo "<br />";
              echo $pizzas[$arraypos2]->description;
              echo "<br />";
              echo $pizzas[$arraypos2]->price;
              echo "<br />";
              $arraypos++;
    }//end of writing data loop
    fclose($menu2);
    ?>
    <body>
    </body>
    </html>
    returns this:
    the array is in position: 1
    Test Pizza Two
    The same as one with an extra one, yum!
    22.99
    the array is in position: 2
    Test Pizza Two
    The same as one with an extra one, yum!
    22.99
    the array is in position: 3
    Test Pizza Two
    The same as one with an extra one, yum!
    22.99
    when it should return this:
    the array is in position: 1
    Test pizza One
    Loaded with all that test pizza goodness! Lots and lots of ones 1111!
    11.99
    the array is in position: 2
    Test Pizza Two
    The same as one with an extra one, yum!
    22.99
    the array is in position: 3
    Test Threeza!
    Do you see what I did there? I added a three to pizza, hahaha, I am so punny.
    33.33
    using the following text file pizzaMenu2.txt:
    1
    Test pizza One
    Loaded with all that test pizza goodness! Lots and lots of ones 1111!
    11.99
    3
    Test Threeza!
    Do you see what I did there? I added a three to pizza, hahaha, I am so punny.
    33.33
    2
    Test Pizza Two
    The same as one with an extra one, yum!
    22.99
    Now, I have done line by line testing and shown that the values are being entered into the proper objects in the proper array, but whatever goes in last overwrites all of the other objects, so in the end I have 3 objects in my array that are all the same. I am not sure what I am missing here.

    Christ-Guard wrote:
    Thanks! I majored in computer science
    That helps enormously.
    Christ-Guard wrote:
    Also, I have never worked a CS job before and I've been out of school for 8 years, so I am better at remembering "This should work" then I am at "This is how I write this code".
    If you have a good idea something should work, based on theory, then that's half the battle.
    Its having no knowledge if something will work or not when it becomes a problem.

  • Database setup with MySQL and PHP question

    Hello all,
    I recently had a problem getting a report to work for a site I was updating.  This site is written in PHP with a MySQL database.  The application is to track customer calls to auto repair stores.  The database has a lot of foreign keys because they wanted to update information in only one spot and have multiple records be updated all at once.  So, I've got all the information from individual calls saved in the call_log table, and have foreign keys to reference information in other tables (for example this table lists what store received the call referencing the store table).  If a store changes locations, they want to have reports automatically update with the new address, connection to conversation number, etc.
    In one of the responses to my question on how to get this report to work, I was told that this could be done without using foreign keys (by Normalizing the database using mapping tables).  I am still a newbie to MySQL, and after looking though a lot of manuals, tutorials, and forum posts, I am more confused now than ever.
    I got the report to work using the foreign keys, but I would like to learn what I should have done with the database (and how to get the information displayed).
    So for example one report would be displaying the following:
               Store                                                      Reason for the Customer Call
                                               breaks             oil change            shocks              tune up         total calls
    5636 - Bloomington                  2                       4                        0                       2                   8
    8875 - Duluth                           1                       6                       4                        8                  19
    with links on the store name to pull up the information on that specific store.  How would I change the database (listed below) to do this without foreign keys?  Any help would be greatly appreciated.
    call_log             (table that contains the following:)
    call_id
    conv_number
    date
    camp_type         (foreign key to the campaign table so it displays the campaign_id)
    reason               (foreign key to the call_reason table so it displays the reason_id)
    location              (foreign key to the store table so it displays the store_id)
    associate
    call_summary
    trainig_issue      (foreign key to the training_points table so it displays the training_key_id)
    visit_closed
    example            (foreign key to the example_type table so it displays the example_id)
    campaign          (table that contains the following:)
    campaign_id
    campaign_name
    campaign_promotion
    campaign_coupon
    campaign_startdate
    campaign_enddate
    call_reason       (table that contains the following:)
    reason_id
    reason
    store               (table that contains the following:)
    store_id
    store_number
    store_address
    store_city
    store_state
    store_postalcode
    store_name
    store_phone
    store_email
    store_mgr
    training_points  (table that contains the following:)
    training_key_id
    key_issue
    policy
    example_type  (table that contains the following:)
    example_id
    example_name
    example_image
    Thank you very much.

    Frankly, that is way to much of a question to be answered in detail on a forum... There's a lot involved and a lot of general database understanding required. I would highly recommend:
    Database Design for Mere Mortals:                       A Hands-On Guide to Relational Database Design, Second                       Edition -- by Michael                     J. Hernandez
    This is an invaluable book to get you going in the right direction and on a firm foundation.
    Lawrence   *Adobe Community Expert*
    www.Cartweaver.com
    Complete Shopping Cart Application for
    Dreamweaver, available in ASP, PHP and CF
    www.twitter.com/LawrenceCramer

  • Another BW question about filter in the query definition

    Hi ,
    I have another question about filter in the query definition.
    <u>Question:</u>
    Which of the following objects can be filtered in the query definition?
    A. characteristic
    B. Key figure
    C. Structure
    D. Units
    E. Hierarchy
    My answer is A,B,D,E.
    The answer in the book is A,B,D
    Can anybody tell me which one is wrong?
    Thanks in advance,
    Liu Jia

    HI
    1.The answer could be A,B,D.you can not apply filters on hierarchies
    2.Whenever there is a change in Attribute data(like Location,Num etc...)that has to be reflected in all aggregates of the cube.Thsi can be done by running "ATTRIBUTE CHANGE RUN".
    sri

  • Another oci8 question

    Hi there,
    Sorry to ask what seems to be a common question, but I've been trawling through threads and walkthroughs for a couple of days now and don't seem to be able to crack the problem I'm having.
    Running Win XP with Oracle 10g installed. I'm using the Apache HTTP server that came with this DB installation, which includes PHP 4 and the oci8 extension. Now trying to connect to my DB in PHP but continually getting the familiar "Fatal Error: Call to undefined function: oci_connect()". Have also tried using OCILogin() but the problem is the same.
    When I run a phpinfo() output, the oci8 module is listed, the directories for php.ini and the php extensions directory are correct, but still can't get past this error.
    It just seems strange that the module is clearly getting picked up by phpinfo but yet still not able to function. Any ideas?
    Thanks,
    Dave

    You were on the right track with the old names. With PHP 4 the names like oci_connect() are not available. Did you have a typo in the script or the post with ocilogin()? It should be ocilogon(). See Appendix C "OCI8 FUNCTION NAMES IN PHP 4 AND PHP 5" in The Underground PHP and Oracle Manual.
    I can't ever recommend anyone use PHP4. It's obsolete and the version of the OCI8 extension it ships with is unstable.
    Where exactly did the Apache install come from? From Oracle Apps Server?

  • Yet another standby question...

    Hi gurus,
    Please help to resolve the quiz. I have completed manual physical standby installation. It is up and running. I then decided to install Grid Control and to use Data Guard for the standby creation. I've successfully installed GC, deployed all agents, I can see my previous standbys, life is good in short. Now, when I am trying to create the second standby for my production database using the Data Guard I stuck on a logical question:
    On the step 3 of Data Guard standby creation, there is a note, saying:
    The instance name (also referred to as the SID) must be unique on the standby host.
    Yeah, fair enough. But i can't understand what should I do next? I have:
    db_name YELLOW - primary prod
    db_name YELLOW - standby prod 1st
    and i need db_name YELLOW - standby 2nd
    But I can't create it on the same server where the first standby resides.. What options do I have? Do I need to create the second standby on another server? Do I need to kill 1st standby? Is there any way to avoid this conflict? I am confused. I have no equipment for TWO standby servers... I thought I can install there up to 9 standbys.. But it seems to be a problem.. And definitely, I cannot give my second standby other name than YELLOW as all my applications are strongly tied on db_name...
    Friends, please clarify this if you can. I am kinda lost in here..
    Thanks as usual,
    Maria

    well, that's a good question! :)
    because I don't have spare server for the standby. the question is not about: 'should I or should not put more than one standbys in one server' , but more about: 'is there any way to put two standbys with the identical db_names in one server'. I know that I probably sound unprofessional, but I just wanna know.. If the answer is 'no way', I will kill the first standby then and recreate the second one using DG with the correct name.
    Thanks for writing to me,
    M.

  • Re: another build question! (sorry lol)

    Hi all
    right, after days and days of researching all the excellent articles on here ive had to write a post! So apologies for going over old ground
    Im going to build a new CS5.5 rig (having had a guts full of Apple and their FCPX fiasco its back to pc!)
    so although i appreciate the 990x o'c is prob best option, bang for  buck is leading me down the sandybridge i7 2600k o'c option on p67 mobo with 16gb of ram (option to take to 32 down the line when the chips are out)
    anyway, im sorted on chip mobo (msi big bang marshal p67), nivida 570 etc , its the drives im struggling on!! Im edit avchd video and some after effects, small amount of 3d, and in FCP i always transcoded everything to prores. Now on cs5.5 it looks like real time performance is possible with high end hardwear.
    So mobo, ram, and chip aside, my HDD config im unsure on, ive not really got the cash to go crazy with raid controllors etc, but understand need for seperate drives, etc and tbh might even go downt he cineform route as a prores alternative (prob avoiding hassles of drive speed with avchd)
    im thinking as the SSD's are now dropping in price and the ocz are producing these 500 mb r/w speed sata 6 120gb drives for a reasonable price, would 3 of these drives (one for os, one for media , one for scracth disk ) be a good set up or is it a waste of cash and should i raid 0 from bios/mobo?
    I appreicate that 120 gb drives for media etc are small, but i would take project media from another much large backup drive and just use the 3x ssd set up as working disks for editing & os? once project over, clear out drives to larger back up and start new project!
    Its either that or i go SSD as bootdrive, but some sort of cheap raid set up for my scratch disk, media drives? prob is if i do that, from what ive read (brain dead now) i would be best off with 2 x raid 0 as scratch disk and orginal media respectively when workign with avchd
    HOWEVER, on my mobo there are only 4 sata 6 ports, so if i use one for ssd boot drive, and then im left with 3 x sata 6 ports and another 4 x sata 3 ports to raid on? how does this work? any point in getting the sata 6 drives as one would be stripped with a sata 6 drive plugged into a sata 3 port (this was my reasoning behind using 3 small sata 6 ssd's plugged to the sata 6 ports  and rest of sata 3 ports as storage and backups!
    confused lol!! I just want the overclocked sandybridge system with decent gpu card, as much ram as possible at present, but im thinking my bottleneck will be in the HDD config! any suggestions are much appreicated! im not that techy so whilst have read all the articles am more confused now (plus normally a mac user, so its out of the box configuration usually!) for what its worth looking to purchase something from scan uk in terms of parts! total build cost including a reasonable screen £2,000
    many thanks

    You have a limited budget, especially in the UK, but then don't we all?
    Going for the 980X will triple the cost of the CPU, but even when editing AVCHD material the gains are not sizable enough IMO to justify that cost differential. Add to that you will need 24 GB instead of 16 GB and that carries an additional price tag. Both factors will easily move you out of budget range if you want to have a number of disks and possibly a raid controller.
    Did you read my article To Raid or not to Raid, that is the question. It can be found under the Overview tab at the top of the page? (Currently responding from abroad on my notebook and not having the bookmarks available for easy linking). http://forums.adobe.com/thread/525263
    With media and projects I would advise against a raid0, because of the lack of redundancy. For pagefile, media cache and previews (scratch disks) raid0 is quite OK. They will be recreated if needed. The performance gain from a raid0 for media and projects over a parity raid is easily offset by the time spent on making backups. For parity raids do not use WD Caviar Blacks, but look at the Hitachi 7K3000 line of disks.
    The question of Sandy Bridge versus the old X58 platform is essentially one of 'which limitations are acceptable to me'.
    The Sandy Bridge is a great processor and at least the equal to the old i7-9xx quad cores. However, the platform, the chipset, has its shortcomings in terms of PCIe lanes. Whether that is relevant to you, only you can decide. But hey, we would be in serious trouble if Intel did not manage some progress in two years time from the i7-920 to the i7-2600K. So of course the i7-2600K shows much more potential than the almost retired 920, it is the chipset for the Sandy Bridge that is 'flawed' in comparison to the X58, but that is no surprise, since the Sandy Bridge is a 'middle-of-the-road' platform and the X58 was a 'high performance' platform.
    BFTB-wise I think that within your budget limits, you should look at the i7-2600K, but with the best disk setup you can afford.

  • Another frameset question

    Hi all,
    I have created a frameset that has three frames - top,
    leftside, main. The
    main frame will have my supplier's site in it (remote) and
    the left will
    have navigation buttons. I want to be able to swap that
    mainframe out with a
    click on a navigation button in the left frame and swap it
    with pages on the
    local server that are not from that supplier (I will create
    them). Then with
    another navigation button, be able to swap back to the
    supplier's remote
    site in that frame. How can I do this?
    I was thinking of swapping the entire frameset with a new
    frameset that has
    the different content in the mainframe. Is that possible (or
    even the best
    way to do it)?
    Thanks so much.

    > Is that possible (or even the best way to do it)?
    Yes, and yes. Just link to the new frameset page.
    But you'd be better served (most likely) to get rid of the
    frames.
    The reason for using or not using frames should be based on
    a) your site's
    needs, and b) your willingness to accept the potential
    problems that frames
    can create for you as developer and maintainer of the site
    and for your
    visitors as casual users of the site.
    I am down on frames because I believe that they create many
    more problems
    than they solve.
    Judging from the posts here, and the kinds of problems that
    are described,
    the kind of person most likely to elect to use frames is also
    the kind of
    person most likely ill-prepared fo solve the ensuing problems
    when they
    arise. If you feel a) that you understand the problems and b)
    that you are
    prepared to handle them when they occur, and c) that you have
    a need to use
    frames, then by all means use them.
    As far as I know, the most comprehensive discussions of
    frames and their
    potential problems can be found on these two links -
    http://apptools.com/rants/framesevil.php
    http://www.tjkdesign.com/articles/frames/
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "peter" <[email protected]> wrote in message
    news:[email protected]...
    > Hi all,
    > I have created a frameset that has three frames - top,
    leftside, main. The
    > main frame will have my supplier's site in it (remote)
    and the left will
    > have navigation buttons. I want to be able to swap that
    mainframe out with
    > a
    > click on a navigation button in the left frame and swap
    it with pages on
    > the
    > local server that are not from that supplier (I will
    create them). Then
    > with
    > another navigation button, be able to swap back to the
    supplier's remote
    > site in that frame. How can I do this?
    >
    > I was thinking of swapping the entire frameset with a
    new frameset that
    > has
    > the different content in the mainframe. Is that possible
    (or even the best
    > way to do it)?
    >
    > Thanks so much.
    >
    >

  • Another Noobie question - readLine()

    Hi all
    This is another one of the extreme noob questions. I wrote a small program to read form a text file
        String NetworkLine = new String();
        try{
            FileReader inputFile = new FileReader("Test.txt");  //
            BufferedReader in = new BufferedReader(inputFile);
           try{
               while (in.readLine() != null){
                NetworkLine = in.readLine();
                System.out.println(NetworkLine);
           }catch (IOException e){
                System.err.println("Error in reading the file");
        }catch (FileNotFoundException e){
            e.printStackTrace();
        }My Test.txt is
    One
    Two
    Three
    Four
    Five
    Six
    without the *
    The output I get is
    Two
    Four
    Six
    I cannot figure out why only even no. lines are being read. I inserted a breakpoint at the line
              System.out.println(NetworkLine);This shows me that only even no. lines are being read by readLine(). Any help will be appreaciated.
    Thanks
    Ayesha

        String NetworkLine = new String();
        try{
            FileReader inputFile = new FileReader("Test.txt");  //
            BufferedReader in = new BufferedReader(inputFile);
           try{
               while (in.readLine() != null){  // <-- This reads a line, checks it for null ,and drops it
                NetworkLine = in.readLine(); // <-- this reads the next line
                System.out.println(NetworkLine);
           }catch (IOException e){
                System.err.println("Error in reading the file");
        }catch (FileNotFoundException e){
            e.printStackTrace();
        }So the upshot is that you print every other line.
    Corrected:
        String networkLine = new String();
        try{
            FileReader inputFile = new FileReader("Test.txt");  //
            BufferedReader in = new BufferedReader(inputFile);
           try{
               while ((networkLine = in.readLine()) != null){
                System.out.println(networkLine);
           }catch (IOException e){
                System.err.println("Error in reading the file");
        }catch (FileNotFoundException e){
            e.printStackTrace();
        }

  • Working with an API (PHP) question

    I am building a mini-app using an API into another back-end
    system. To
    extract data from this system, I can use PHP lines like this
    $stats = $q->campaignStats($cid);
    where the variable "$q" has been previously loaded with
    values.
    What I want to know is - can I programatically generate this
    line? What I'd
    LIKE to do would be something like this (analogous to the way
    that DW builds
    query strings) -
    $statsQuery = 'campaign' . $command . "($cid)"
    and then I can set $command to any of a number of different
    values, e.g.,
    "ClickStats", "Bounces", "Unsubscribes", etc.
    Now - what I don't know how to do is to then reference this
    string in a way
    that executes the command, as I'm fairly sure that -
    $stats = $q->$statsQuery; would fail (but I'm going to try
    it of course).
    Is there a special way to handle such things?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================

    Thanks, Micha! My earlier imagined way didn't work, not
    surprisingly!
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Michael Fesser" <[email protected]> wrote in message
    news:[email protected]..
    > .oO(Murray *ACE*)
    >
    >>I am building a mini-app using an API into another
    back-end system. To
    >>extract data from this system, I can use PHP lines
    like this -
    >>
    >>$stats = $q->campaignStats($cid);
    >>
    >>where the variable "$q" has been previously loaded
    with values.
    >>
    >>What I want to know is - can I programatically
    generate this line? What
    >>I'd
    >>LIKE to do would be something like this (analogous to
    the way that DW
    >>builds
    >>query strings) -
    >>
    >>$statsQuery = 'campaign' . $command . "($cid)"
    >>
    >>and then I can set $command to any of a number of
    different values, e.g.,
    >>"ClickStats", "Bounces", "Unsubscribes", etc.
    >>
    >>Now - what I don't know how to do is to then
    reference this string in a
    >>way
    >>that executes the command, as I'm fairly sure that -
    >>
    >>$stats = $q->$statsQuery; would fail (but I'm
    going to try it of course).
    >
    > The function name can be taken from a variable, so you
    can use something
    > like
    >
    > $statsQuery = "campaign$command";
    > $stats = $q->$statsQuery($cid);
    >
    > For other ways of calling such "dynamic" functions have
    a look at
    > call_user_func() and call_user_func_array() if
    necessary.
    >
    > Micha

  • Another beginner question about targeting functions

    I've read what I thought was an excellent thread about scope in EA, but I'm still not getting some of the basics (btw the thread was http://forums.adobe.com/message/5287753#5287753).
    I have "slides" in the symbol library and in the main composition compositionReady script I've set up a generic script for playing back sound. That script works fine when I bind it within the compositionReady script to a symbol and click, so I know the funciton itself is fine. My question, I'm programmatically loading the slides from the library as I go along and want to use the generic function I created in the compositionReady script, but I can't seem to create the proper syntax to call the script. Here's some that I have tried. What is the correct syntax? The script is on frame inside the slide symbol.
    //sym.getComposition().getStage().playSound();
    //sym.getComposition().playSound();
    //Edge.getComposition("CER_1").playSound();

    Thanks for having a look. Yea, it's getting to the script fine but it doesn't like the syntax. Console always indicates javascript error, which is what happens when Edge throws an exception because it doesn't know what to do. The article that Elaine posted on above gives me the sense that it might be best to change the function to a variable, then it would be in scope to call but I have parameters I'd like to pass with it and I don't think  I can pass a parameter with to a variabalized (word?) function. I know it's just me moving from ActionScript to Edge JavaScript and scope. Whereas I could always find a homebase in ActionScript with the stage, it seems that the stage in Edge is just another symbol and calling a function within the stage is never getting there. Elaine hints at putting outside the stage closure and it would be accessible, which, of course, has led me to start readying JavaScript books and learning more about scope etc. It seems like that is life as a developer. I  dont' get that, oh, better take a day or two to  understand that concept, oh, that function works now, next problem. ;-)

Maybe you are looking for