Re: [PHP] download file from an ajax request

2008-06-20 Thread pere roca ristol
   yes Iv, surely this is a more js/Ajax issue... this is the one who has to
do something with php answer.
   sorry,

   Pere

2008/6/20 Iv Ray <[EMAIL PROTECTED]>:

> Eric Butera wrote:
>
>> The only thing I can think of is using JS to create some sort of
>> IFRAME, meta redirect, window.location, or a popup window, something
>> that will force the page to hit your download script directly.  I've
>> never attempted it myself so I'm not sure what sort of issues IE would
>> have with any of the above.
>>
>
> Well, if we, the illiterate, are going to brainstorm ;) - clicking a
> link/button/image executes JavaScript function, which (via AJAX request)
> hits the php download script. The response will be received by the AJAX
> object.
>
> Nothing php here.
>
> As far as I see the problem, it is - how to pass this response to the
> browser in an elegant way, so that the browser will open a "Save as..."
> dialogue and will direct the stream there.
>
> One could ask this on a JavaScript/AJAX list.
>
> Iv
>


Re: [PHP] manipulating XML via php DOM

2007-11-21 Thread pere roca ristol
Jonas, that's what I want to get (and is valid).
Thanks,
...


  
   genus
ontophaugs332
 



 
   genus
   ontophaugs332
 

  
   genus
ontophaugs
 



...

2007/11/21, Jonas Geiregat <[EMAIL PROTECTED]>:
>
> I don't think it is valid to have an opening tag and a closing tag with
> nothing in between. So an initial  and a final , as you recall
> it, should become .
> Second, I'm not sure I understand what you want to accomplish. From the
> example document you added is this the result you expect:
>
> 
>
>   
> genus
> ontophaugs332
>   
>
> 
> 
> 
>
>
> Regards
>
> Jonas
>
> On Tue, 2007-11-20 at 10:27 -0800, pere roca wrote:
> > please, I need some help with php DOM, for me it's becoming a hell!
> >
> > After trying other methods (check message from 19th november, called
> "php
> > DOM question"), I'm getting a little more success to manipulate XML.
> >
> > From the code you can see below you generate this xml. Now I just want
> to
> > keep only the initial  and the final . How can I access and
> delete
> > the other (the "between" tags)?
> > I suppose there is no way to create an initial  without the
> associated
> > .
> > Thanks a lot,
> >
> > Pere
> >
> > This is the WRONG XML generated from code.
> > ...
> > 
> >
> >   
> > genus
> > ontophaugs332
> >   
> >
> > 
> >
> >
> >  genus
> > copris
> >
> > 
> > 
> >
> >
> >  genus
> > copris2
> >
> > 
> > 
> >
> >  > $species=array('ontophaugs332','copris','copris2');
> > $dom = new DOMDocument;
> > //XML we will insert the data to
> > $dom -> load('edit_iberia3.xml');
> >
> >
> > $count=count($species);
> >
> > foreach ($species as $sp=>$value) {
> > //we pass parameters of the array
> >
> >   $where_to_insert= $dom->getElementsByTagName('And')->item(0);
> >
> >   $child = $dom->createElement('Or');
> > $or=$where_to_insert->appendChild($child);
> >
> >   $child = $dom->createElement('PropertyIsEqualTo');
> > $first=$or->appendChild($child);
> >
> >   $child2 = $dom->createElement('PropertyName');
> >   $first->appendChild($child2);
> >
> >   $child3 = $dom->createElement('Literal');
> >   $first->appendChild($child3);
> >
> >   //inserting the array data
> >   $values = $dom->createTextNode($value);
> >   $values = $child3->appendChild($values);
> >  }
> >
> > echo $dom->save(nou_iberia);
> > ?>
> > --
> > View this message in context:
> http://www.nabble.com/manipulating-XML-via-php-DOM-tf4845510.html#a13862945
> > Sent from the PHP - General mailing list archive at Nabble.com.
> >
>
>


Re: [PHP] uploading files... necessary Ajax?

2007-11-21 Thread pere roca ristol
  Thanks for the answer,
  you are right, Jay, I don't want nor reload the page nor a new .php page
(the one that works with the data I post) appears. It's difficult to believe
that a so dummy thing is not working in php (without Ajax)!
   I found this URL explaining ajax/php for uploading files.
http://www.anyexample.com/programming/php/php_ajax_example__asynchronous_file_upload.xml

   Pere

2007/11/21, Jay Blanchard <[EMAIL PROTECTED]>:
>
> [snip]
> Seems to me Pere want's to do an upload without reloading the whole
> page.
> [/snip]
>
> The problem is that you cannot upload files using Ajax alone. But you
> can do it without a reload, requires an invisible IFRAME and a little
> technique. Search Google for several different articles on this.
>