Lucio Fulci's intended title for the film was "Perversion Story". While the film was released under that title in France, producer Edmondo Amati elected to use the title for the Italian release of a Spanish film he co-produced, Murder by Music (1969), and retitle this film "Una sull'altra" (which had previously been used in press notices prior to the start of shooting), the translation of which, "One on Top of the Other", was used for its theatrical and VHS release in English-speaking countries. The "Perversion Story" title was later used for its DVD and Blu-ray releases.
It reportedly took Lucio Fulci and Roberto Gianviti over a year to write the script, because Fulci was determined to make a thriller with (in his words) "no cops, in which the story unfolds 'internally'", and thus had difficulty giving the film a satisfactory finale. In his later life, he would declare the script to be one of his best works, and was especially proud to have made a successful giallo prior to the genre's mainstream popularity following the release of Dario Argento's The Bird with the Crystal Plumage (1970).
Lucio Fulci and Roberto Gianviti's script originally took place in Louisiana (the setting of Fulci's later films The Beyond (1981) and Le porte del silenzio (1991)), and featured a symbolic pre-title sequence that was to be shot in the state's trademark wetlands, depicting a garden spider ensnaring a locust in its web and eating it, leaving only its shell. It was rewritten to take place in San Francisco as a cost-saving measure due to producer Edmondo Amati wanting to have the film shot back-to-back with another film he was producing, Carnal Circuit (1969), the exteriors for which were shot in Los Angeles. Similarly, George was originally written to have his death sentence carried out via electric chair, but due to the location shift, this was changed to the infamous gas chamber in San Quentin Prison in which Caryl Chessman had been killed, a fact especially highlighted by the film's trailer, which stated that much of the prison staff responsible for Chessman's execution "reprised" their roles for the film. These alterations were likely implemented into the script by assistant director Massimo Castellani, Franco Ferrari and Massimo Franciosa, who were credited on the film's budget sheet but not in the onscreen credits.
Six degrees of "Diabolik": in 1965 British director Seth Holt set out to make a film out of the Italian comic strip "Diabolik", casting Jean Sorel and Elsa Martinelli, who play Dr. George Dumurrier and Jane as Diabolik and his lover Eva Kant. The film never got beyond the planning stage, although photographs of the duo in costume survive. When Mario Bava successfully brought "Diabolik" to the screen three years later--Danger: Diabolik (1968)--Marisa Mell, who plays Susan/Monica, starred as Eva Kant.
Claudine Auger, Andrea Bosic and Luis Dávila were originally cast as Jane Bleeker, Inspector Wald and Larry, but were replaced just before the start of filming by Elsa Martinelli, John Ireland and Jean Sobieski respectively.