Hi
I am doing an exercise with these tools.
My xml contains the details of universities and so on.
Now i used simple XML
upto now:
I load the XML file and queried Using Xpath for universities
I got the results : the result has 5 university names
Now
i need to click on one university name which will take to another php page
where that provides the complete detail of that university.

Note: i tried to use session but not succeeded.

Could you please provide some ideas or Hints. Or any alternate method is there to do /?

I need it URgent
Priya

    Hi
    I am doing an exercise with these tools.
    My xml contains the details of universities and so on.
    Now i used simple XML
    upto now:
    I load the XML file and queried Using Xpath for universities
    I got the results : the result has 5 university names
    Now
    i need to click on one university name which will take to another php page
    where that provides the complete detail of that university.

    Note: i tried to use session but not succeeded.

    Could you please provide some ideas or Hints. Or any alternate method is there to do /?

    I need it URgent
    Priya

      Hi Priya,

      A few considerations:

      • I notice that you have posted this message in two forums. This is really 'not done'. It clogs up the forums, and people cannot see the other suggestions made

      • You mention you need it urgently. Do you really think that we are going to respond faster? If anything, it will make people less likely to respon quickly.

      That being said: I assume you can jsut create a simple link instead of text, which should have the following structure:

      <a href="showuniversity.php?uid=1">view MIT details</a>

      Where:
      showuniversity.php = The poage that will be showing the university details
      uid = the name of the variable you can use to determine which university show
      1 = the ID of the university to show (In this case the record ID of MIT)

      Cheers,

      Jelle.

        Hai
        Thanks for the mail advice!

        I am in confusion with your code

        I add here my code and explain you

        if($employee =="University"){
        printf("List of Universities");
        echo "<br />";
        foreach($Query->University as $book) {

                   	    foreach($book->University as $uni) {     
        
        	             echo "<br />";
        	            echo "<a href=\"a.php  \">$uni</a>";
        	             echo "<br />";
        
        
        	          }
        	              }

        }

        So in this code $uni will output the university names. i have 5 answers.
        I am going to click the 3rd university Name. So How can i proceed
        I think your code has to be improved little bit. ID, dynamic is it.
        Cant I use the name and try to find the complete details.

        Cheers
        Priya

          Hi,

          Yes you could. I prefer to use the record ID, but as I am not sure how your querying works (😃) I will stick to the simple solution

          echo "<a href=\"a.php?u=".$uni."\">$uni</a>";
          

          On the a.php page e.g.,:

          $uniname = mysql_real_escape_string($_GET['u']);
          
          $query = "select * from university_table where u_name = '".$uniname."' limit 1";
          

            Hi, I am not using PHP & MySql.
            My target is . to query the data of the XML docs. NOT MySql data.

              hm.. as my grandfather -may he rest in peace- used to say.. I am happy if you learn two things in my class: Learn to listen, and learn to read. Appearently I still need to do the second. Sorry about that. The general approach will stay the same, but my XML processing skills are too poor to get you anywhere useful in finding the record on the 'show university' page.

                Write a Reply...