facing problem with xampp
am new to php and i was working in signup sysytem but when i try to see my work i face this error
does anyone know the solution i search in the net and i try what i found but nothing work with me
40 Replies
That is almost always an error in your code somewhere, a more detailed error should be available in the PHP Error log
if you're using an IDE with syntax checking, there's actually probably a red squiggle somewhere in the file you're trying to open too
i got this mssg but idk what mean or where i look
i can show u all my codes
+ idk what IDE mean
the log is more useful, can you copy/paste (instead of screenshot) the messages before and after that?
IDE is something like VSCode or Jetbrains, a specific editor with bells and whistles to write code more efficiently
actually, yeah, your code would be handy. Please share it in a codeblock, you can start one with ```php and end it with ```, each on their own like
this one for connection with db
Change that last line to thi:
the formatting of that string is very important
i put ( ./) cz its is another file
wait let me show the rest of codes
did changing that line work?
nah
and without the
.
?
or even without the /
it worked '-'
without .
yeah, I thought
.
wasn't allowed in Location headers, but second guessed myselfthat all my files
they are sepreted from each other
that why i put .
that's not quite how the Location header works
I assume you're including
signup.inc.php
from index.php
? The browser and even the webserver will only see index.php
, and that's who you're talking to with header()
.oh thnx alot men i rly appreciate ur help am crying cz i spent like 3 days searching XD
glad to help! Errors can be annoying and cryptic sometimes, and there's a lot of background knowledge that you build up over time to help figure out what the problem is, it takes time 🙂
Feel free to ask sooner though, the channel's always here and if you solve your issue yourself before anyone answers, you can answer the question yourself and someone else might find the answer to their problem!
alright man thnx again
@Jochem bro the same sht happen again the error back x(
am gonna quite ik
what is the error in your log file this time?
same one as bfr
is there another
header
call in a different file with the same problem?yeah there is but i write them as u said
the error is exactly the same in the log file? you're sure it isn't the error from an earlier request?
nah am sure its the same
try searching all your code files for
'location '
with the space, you mus've missed one somewhere
i only add this
That should be fine, as long as you change it to
Location: /ind...
location
isn't the same as Location
and the header you want is Location
even tho if am gonna try my error system this mssg appear in am face
i tried everything XD with L or l
i rewrite the code like 5 time
am watching tutorial and am doing the same thing but idk why this happened to me only
he writed the header location with ../ and worked for him fine
You removed the space between
location
and :
and added one after the :
?yeah i removed
it worked once and i got the log in user info in ma db
but it stopped after
is it still printing fresh versions of the error to the log? If not, it might be a caching issue
i got another one
this one appear just now
the requested url is not found in this server
try removing the / then, so
header('Location: index.php?signup=success');
same error 😦
the new one this time
how are you refreshing the page?
old way
am not pressing f5
i save everything in mt VS and refresh the webpage
its the 404 error
right, so if you change that location, you'll have to resubmit the form instead of just refreshing the 404 page
i think i solved now
let me double check
everything is work well now uuuf
i rewrited me location header with ../ and i checked for pervious codes and found that that some codes have <
now i only need my css to appear my error in my page
cool, nice that it's solved 🙂
oh man i was cursing the day i decided to learn web dev LOL