  The production cross section of heavy quarks in real and virtual
photon-photon collisions has been studied. The unintegrated gluon density in
the photon was obtained using the full CCFM evolution equation for the first
time. The gluon density was implemented in the Monte Carlo generator CASCADE,
and cross sections for heavy quark production in $e^+e^-$ collisions were
calculated and compared to LEP data. Also, predictions for heavy quark cross
sections in $e^+e^-$ and $\gamma\gamma$ collisions at TESLA energies are given.
