# Why doesn't electric flux depend on a charge outside the surface? [duplicate]

Let us assume a gaussian sphere with zero charges inside it, then the flux will also be zero in accordance to Gauss' law. But if we have a charge or many charges outside the sphere such that the electrical field lines of that charge passes through the sphere, then we definitely have electrical flux on the surface. But this contradicts Gauss' law that the electrical flux depends on the charges inside the sphere. Here is a picture for reference...

Here you can see that the charge outside the sphere has some of its electrical field lines going through the surface. Thus there must be some electric flux on the sphere, right?

My question arises when we were learning about the electric field inside a spherical conductor with charges (many charges) on its surface. My textbook tells me that since the sphere encloses no charge because all the charge inside the conductor comes onto the surface, the electric flux is zero. Thus the electric field is also zero. But my question is why isn't the charges outside the sphere contributing to the electric flux?