Well it is something wrong with index.php but strangely it's saying
that it occurs on this line:
<script src="itanu_files/prototype.js"></script>

... but why do you really need to change the header:
 header('Content-type: text/html; charset=utf-8');

if in my index.php that's included in the create_clone one is
allready:
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">


> Yes, it could be something inside the code it's requiring that is  
> issuing a header. But it could still be an error in the code inside  
> your index.php page. Im nnot aware of anything in MAR itself that can  
> cause this error.
>
> Try this (it's a good general debugging trick): inside the index.php,  
> commet oout all of the header() calls, and then access the page using  
> Firebug. Look at the response (in Firebug's Console tab) to see what,  
> if anything, is being printed to the browser. You may have an error in  
> there that isn't being properly trapped, although I'm not seeing it if  
> that's the case.
>
> Walter
>
> On Jul 3, 2009, at 11:31 AM, WLQ wrote:
>
>
>
> > Could the "require_once" do something? Because this is the only
> > outside content I have. In particularly it's the index.php - so this
> > way the daabaase and everything else is configured.
>
> >> Check your script for any whitespace (spaces, newlines, aything at

>
 >> all) outside ofthe <?pphp ?> delimiters. Something is printing
some
> >> content to the page buffer before the header is being sent, and  
> >> that's
> >> the problem. It doesn't need to be anything you wrote, it could be an
> >> extra space at the top of your script, or if your text editor likes  
> >> to
> >> put a BOM at the top of the file, it could be that.
>
> >> Walter
>
> >> On Jul 3, 2009, at 9:54 AM, WLQ wrote:
>
> >>> Unfortunately it's not them who create a problem.
>
> >>> THis is the code I use:
>
> >>> $original = $POTT[''original'];
> >>> if($master = MyActiveRecord::FindById('widgets',$original)){
>>>        $daat  =get_oobjject_vars($master);
> >>>        arrayshifft(data);
> >>>    
     $new = MyActiveRecord::Create('clones',$data);
> >>>       $w->save();

>
> >>>        if(false === $new->get_errors()){
> >>>                header('Content-type: text/html; charset=utf-8');
>
> >>>                print 'item_'  ew--id;i
>
> >>>        }else{
> >>>                header('HTTP/1.0 500 Server Error',true,500);
> >>>                exit;
> >>>        }
> >>> }else{
>
> >>>        header('HTTP/1.0 404 Missing',true,404);
>
> >>> }
>
> >>>> Those errors wont occur when you remove the "echo" / "print_r"
> >>>> statements
> >>>> ... they are just moaning about the web server detecting content  
> >>>> and
> >>>> expressing its own headers...
>
> >>>> If you remove the lines i asked u to add it will be fine
>
> >>>> Alex
>
> >>>> ----- Original Message -----
> >>>> From: "WLQ" <[email protected]>
> >>>> To: "Prototype & script.aculo.us" 
> >>>> <[email protected]
>
> >>>> Sent: Friday, July 03, 2009 1:53 PM
> >>>> Subject: [Proto-Scripty] Re: MySQL - order
>
> >>>> Well
>
> >>>> widgets Object ( [id] =>  mm] =] 3..00 00 [description] => 3
> >>>>> [position] => 3 [updated_at] => 2009-06-05 14:07 )7 )
>
> >>>>> And the second one ($original) returned an id of 3. So the  
> >>>>> answer is
> >>>>> you should write $master instead of $original.
>
> >>>>> So this problem is solved, but the errors won't stop. You solve  
> >>>>> one
> >>>>> problem and here you go another one:
> >>>>> Cannot modify header information - headers already sent by (output
> >>>>> started at:1) LOCATION: line 8
>
> >>>>>> If anything it should be $master as thats what is most likely to
> >>>>>> be an
> >>>>>> array.... I dont know MAR at all but unless it ass th the  I do
> >>>>>> into a
> >>>>>> loop
> >>>>>> then t is iais ms moe likt into be an id/stringt thaMhaMAR
> >>>>>> array...
>
> >>>>>> To test
>
> >>>> er......... .
>

 >
 > r> ray.y.> p
> >>>> t_r($me /; // // shto d return .. {
>
> >>>>>> eay
> >>> an array or
> >>>>>> object)
>
> >>>>>> ----- igininal Messag-------
>>>>> Fm Fm:/:/ shQ" <[email protected].>
>>
> >>>> (noTo: "Prototype & script.aculo.us"
> >>>>>>[email protected]
>
>>>>>> S Sent: Friday, July 03,09 12:51:51 PM
> >>>>>> Subject: [Proto-Scripty] Re: MySQL - order ID
> >>>>> orde
> >>>>> ID
>
> >>>>> d it then be:
> >>>>>> $data get_tbject_v_vars($mas);
>
>>>>>>>>> In
> Instd ofof:
> >>>>>> $dataet_bjecobject_var ordei ID
>
> >>>>>> be:
> >>>> a>> $datgh thehe and thnd third line;
> >>>> owly anrefuly. Loyk atok at
> >>>>>ach vaciabariablet is eing eing t andnd each variable tha bein
> >>
>>>>>>>>>> read.
> >>>>>>> (Vales l. Leyleft of t of the = are being set.) Ask ylf
> >>>>
 >>>>>>> wht's
>>>>>
 >>>>>>> suppobe  arrying, rying, andee if f you can spot what i
> >>>>>>>
>>>>>>> really is
> >>>>>>> instead.
>
 two, I assignue tovalue to a variable,
> >>>>>>> but on
>ablne 3, line 3, I forgot to use it and used something else instead.
>
> >>>>>>> Walter
>
> >>>>>>> On Jul 2, 2009, at 6:09 AM, WLQ wrote:
>
> >>>>>>>> This is as far as I've been able to go, please tell what's  
> >>>>>>>> wrong.
>
> >>>>>>>> $original = $_POST['original'];
> >>>>>>>> if($master = MyActiveRecord::FindById('widgets',$original)){
> >>>>>>>> $dat> $data = get__vject_varginal);
> >>>>>>>> if ( is_array($data)
> >>>>>>>> arra
> > rshift($d(> >>>>>>>> $ne
> >>>>>>>> $ne=data);
i( is
> >>>> rray($if ne issave();
> rray(f newe>save();){
> >>>>>>>> header('ContA> > yda= g= g/htr('CcA> >u> ydag= g/h
g= g/h
> >>>>>>>> //tve();
> >>>>>>>t iou /ou ne);
> >>>>ou
ft>> pririr'r'i.e'i.em_ew-'i.eirider''C
> > ntensteC
> >>nt
nt> >s >>>nten>HTTP/1.T 50.0 500  50.0rTTP See,t0.0,/1u>>
t0.0,> r>
>f,treu ne
> >>>>>>>> >>>
 >>>u nitet iteite
 it
se> se{
> >>> . >>04 M
> >>> .',true,41.0;
>
> >>>>>>>> ror
>>>> ror

 >>>>>
>>>>>>>>>>>here
> >>>>>>>>> in>>> in fr y >.
>>>> i
>>>>>>>>> >>>>>r
Walt
r
 >>>>>> W On Jul 1, 1, 2009t at 1ul 1  2009rotro
>
> M,>>>>>>>> I understand unshould plem, is:
> >>>>>>>>>> i iss_array($data)) {
> >>>>>>>>>> array_shift($data);
> >>>>>>>>>> }
>
> >>>>>>>>>> Instead of:
> >>>>>>>>>> array_shift($datda;
>
> >>>>>>>>>>> Or jus>>>> ....
>
> >>>>>>>>>>>>.
..
> >>>y($data)) {
> >> >>>>>>>>>>rray_shift($data);
>
> >>>>>>>>>>> }
>
> >>>>>>>>>>> HTH Alex
>
> >>>>>>>>>>> ----- Original Message -----
> >>>>>>>>>>> From: "Walter Lee [email protected]>
> >>>>>>>>>>> To: <[email protected]>
> >>>>>>>>>>> Sent: Wednesday, July 01, 2009 5:56 PM
> >>>>>>>>>>> Subject: [Proto-Scripty] Re: MySQL - order ID
>
> >>>>>>>>>>>> Which means it's not getting an array. So look and see
> >>>>>>>>>>>> whate whaS
> >>>>> it IS
> >>>>>>>> getting. What is the value of $dvaluetof $datoint? (Use echo(),
> >>>>>>>> se e>ho
>_r(), see that it ke that to output the value.)
>
> >>>>>>>>>>>> I can see tI canrsee ight away, looking back ovey, loaking
> >>>>>>>>>>>> the va
> >>>>>>>>>>>> a
> >>>>>> s  >>>>> f> >>>>>> pi >>>>>  on my part intmyduced while
> >>>>>> refactoring the
>>>>>>> he va>ue.)working code into an example you could picamcle you d
ould>>>> learn from l
>
> >earn
ro>>>>>>>>>> stand on
>>>>>>>>>>>>>> your
> >>>>>>>>>>>> own here.
>
> >>>>>>>>>>>> Walter
>
>>>>>>> Wa>>>>> On Jul 1> you9, at 10:31 AM, WLQ wrote31 AM
>
> >>>>>>>>>>>>> But here's what I get in et I g
t i>>>>>>>>>>>> array_shift() [function.array-shift]ere's what I t
should
> >>>>>>>>>>>>> be an
> >>>>>>>>>>>>> array
>
> >>>>>>>>>>>>> On this line:
> >>>>>>>>>>>>> array_shift($data);
>
> >>>>>>>>>>>>>> Yes. Like any example that you will ever find on the Web,
> >>>>>>>>>>>>>> this
> >>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>> needs to be adjusted to match your environment. Some  
> >>>>>>>>>>>>>> basic
> >>>>>>>>>>>>>> fluency in
> >>>>>>>>>>>>>> PHP is a requirement to use the MAR system, it can't  
> >>>>>>>>>>>>>> divine
> >>>>>>>>>>>>>> everything
> >>>>>>>>>>>>>> for you.
>
> >>>>>>>>>>>>>> Walter
>
> >>>>>>>>>>>>>> On Jul 1, 2009, at 5:57 AM, WLQ wrote:
>
> >>>>>>>>>>>>>>> Right, shouldn't then that be 'widgets'? Because the
> >>>>>>>>>>>>>>> table of
> >>>>>>>>>>>>>>> our
> >>>>>>>>>>>>>>> original sortable list were controlled by the widgets
> >>>>>>>>>>>>>>> table.
> >>>>>>>>>>>>>>> So
> >>>>>>>>>>>>>>> like:
> >>>>>>>>>>>>>>> if($master = MyActiveRecord::FindById('widgets',
> >>>>>>>>>>>>>>> $original)){
>
> >>>>>>>>>>>>>>>> Originals is a table in the database, it contains one
> >>>>>>>>>>>>>>>> of each
> >>>>>>>>>>>>>>>> type of
> >>>>> pe of
> >>>>>>>>>>>>>> thinu wish to be able to clone into the clones tabl clones 
> >>>>>>>>>>>>>> table.
> >>>>>>>>>>>>>>>> MyActiveRecord   to be able to
> >> lone int>> teach table you "wrap"
> >>>>>>>>>>>>>>>> it
> >>>>>>>>>>>>>>>> around, and each row ofsh to be able om clone iject of
> >>>>>>>>>>>>>>>> that
> >>>>> hat

> >>>>>>>>>>>>> class
> >>>>>>> cl>>>>>>> when
> >>>>>>>>>>>>>>>> you reuest it througgh MAR.
>
> >>>>>>>>>>>>>>>> In shf that
>
> >>>>>>>> f the>>> if($master =
> >>>>>>>>>>>>>>>> MyActiveRecord::FindById'oriigina>>>>>>>>> when){
>
>
 >>>>>>>>>>>>>>>> ...if it finds aord::e called 'originals' in  inr
> >>>>>>>>>>>>>>>> database,
> >>>>>>>>>>>>>>>> will
> >>>>>>>>>>>>>>>> ret return the rothwith thematching $original (or  
> >>>>>>>>>>>>>>>> false).
>
> >>>>>>>>>>>>>>>> Walter
>
> >>>>>>>>>>>>>>>> On Ju>>>>> return t 1 row wit W >>>>>>>>>>>>>
> >> Walter
>
> >>>>>>>>>> It says - Class originals does not exist
> >>>>>>>>>>>>>>>>> iginal (or fal o).
>
> >> ss  class comes from? What is the
> >>>>>>>>>>>>>>>> originals
> >>>>>>>>>>>>>> ass from
> >>>>>> What is>the
> >>>>>>> above?
>
> >>>>>>>>>>>>>>>>>> If this is  >  code you arhere doe( the origind>  the
> >>>>>>>>>>>>>>>>>> missing
> >>>>>>>>>>>>>>>>>> close
> >>>>>>>>>>>>>>>>>>> parenthesis), then the fact that you are g close a
> >>>>>>>>>>>>>>>>>>>> 200 back
> >>>>>>>>>>>>>>>>>> (and a
> >>>>>>>>>>>>>>>>>> new
> >>>>>>>>>>>>>>>>>> ID) means that you have successfully created a new
> >>>>>>>>>>>>>>>>>> clone.
> >>>>>>> u have>>>>> Othelly creat
> >>>>>>>>>>>>>>>>> you should be getting a 500 or 404 back.
>
> >>>>>>>>>>>>>>>>>> //create_clone.php
> >>>>>>>>>>>>>>>>>> $original = $_POST['original'];
> >>>>>>>>>>>>>>>>>> if($master = MyActiveRecord::FindById('originals',
> >>>>>>>>>>>>>>>>>> $original)){
> >>>>>>>>>>>>>>>>>> $data = get_object_vars($rs(ginal);
> >>>>>>>>>>>>>>>>>> array_shift($data); //get rid of the ID
>
> ...
>
> read more »
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to