Actually , am working on my PhD , am in the middle of the way , world- known universities will not accept credits done in another school
Most PhD programs, even the fancy ones, will accept course transfer credits from a graduate program from another R1 program, even one rated near the bottom of the top 100 (which BTW is still very good). However, if those credits are used for another degree then you obviously don't get to use them again.
the idea is just to do the first phd for the sake of publications and recommendation
This isn't going to work if you want another PhD in a close field from another school, sorry. For example, if you are getting your PhD in Computer Engineering (part of CS departments at some schools, and part of EE departments in others) no reputable EE department will then let you get a PhD in this field from them.
,some of you will suggest to use the credits to get masters frommy current university and then pursue phd in a better school do you think this is workable
Yes, this is exactly the way to do it.
my objective of attending reputable school is the NAME
I know that us whatever I work on but also the name is important factor in finding a job
If you hope for an academic job, or even a quasi-academic one (government lab, major company like MS or Intel, etc.) then they might care about the quality of your department but will not base their idea of what that quality is on US News. - DvF