4

I have a Php page the code for which is below, I am trying to apply this signup.css but its not working. In PHP admin I can see the CSS shows up under Styles as SignUp.css, I have just placed this css in my theme directory under my theme as SignUp.css, I have tried "Signup.css" , created a css folder and put this css in there and tried "css/SignUp.css" but that did not work either. Please help . Thanks for your time

<html>
<link href="Styles/Signup.css" media="all" rel="stylesheet" type="text/css"/>

    <head>
        <title>Create</title>
        </head>
<body>

<?php

if($_POST['action']=='create'){
    //include database configuration
    $dbhost = "localhost";
     $dbuser = "abc";
     $dbpass = "xyz";
     $dbname = "test";

     $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
     mysql_select_db($dbname) or die ('Unable to select database!');


    //sql insert statement
    $sql="insert into user ( firstname, lastname, username, Email, password )
            values ('{$_POST['firstname']}','{$_POST['lastname']}','{$_POST['Email']}','{$_POST['username']}','{$_POST['password']}')"; 

    //insert query to the database
    if(mysql_query($sql)){
        //if successful query
        echo "New record was saved.";
    }else{
        //if query failed
        die($sql.">>".mysql_error());
    }
}
?>

<!--we have our html form here where user information will be entered-->
<div id="stylized" class="myform">
<form id="form" name="form" method="post" action="index.html">
<h1>Sign-up form</h1>


<label>Name
<span class="small"></span>
</label>
<input type="text" name="name" id="name" />

<label>Email
<span class="small"></span>
</label>
<input type="text" name="email" id="email" />

<label>Password
<span class="small">Min. size 6 chars</span>
</label>
<input type="text" name="password" id="password" />

<button type="submit">Sign-up</button>
<div class="spacer"></div>

</form>
</div>

</body>
</html>
1
  • As well as moving the link tag inside the head tag.. you might want to change file names and directory names to all lowercase. Some *nix servers default to only lower case titles. Commented Jan 8, 2012 at 23:00

3 Answers 3

12

From you comments on existing answers, it doesn't look like something we could find out based on the provided code. Here are a couple of things that could help you diagnose the problem though.

In your browser, open up developer tools. (For Firefox, get Firebug and hit F12, For Chrome or Opera, just hit F12 for the built in tools.)

Then you want to open up the network tab ('Net' in Firebug, 'Network' in Chrome)

Once you have that open, reload the page and look at the server requests. One of them will be for your CSS file. What you want to look for is the HTTP status. If that Status is anything starting with a 4, you've got trouble. Either it's a 403 which means you don't have the correct permissions to load the file, or you'll have a 404, as we all know, 'not found', which would indicate that your URL is faulty.


Another way to quickly find out whether the file is actually loading is to view the source of the page in the browser, and click the link to the CSS file. In Firefox, doing that makes the source viewer load the contents of the CSS file instead. If that doesn't work out, you also get an idea that it can't be accessed. It's worth noting that the first method will make it clearer what exactly the issue is though.

Most likely I assume you have a typo in your capitalisation of the file name or path. If it is hosted on a non-windows server, that almost certainly makes a difference.

Sign up to request clarification or add additional context in comments.

2 Comments

<link href="/mysite/wp-includes/css/Signup.css" media="all" rel="stylesheet" type="text/css"/>
<link href="/mysite/wp-includes/css/Signup.css" media="all" rel="stylesheet" type="text/css"/> Changed to this and its working now. I completely forgot i can use developer tools to see if my css is being rendered, Thanks.
3

The <link> tag should be within your <head> tag, also consider using absolute "/" path rather than relative if you have sub directories.

2 Comments

I have tried this <head> <title>Create</title> <link href="/Styles/Signup.css" media="all" rel="stylesheet" type="text/css"/> </head> but its still not working, I have created this Signup.css under a subdircetory called css so i tried "/css/signup.css" and "css/Signup.css" but that did not work either. In php admin page this css sheet shows under Styles so I tried "Styles/Signup.css" and "styles/Signup.css" but no luck
does the file exist? can you hit it externally via the URL you provided?
2

Use an absolute Path for the stylesheet based on your website:

<link href="/Styles/Signup.css" media="all" rel="stylesheet" type="text/css"/>

(Note the slash before Styles).

Also, put the style within your <head> tags.

2 Comments

I have tried this <head> <title>Create</title> <link href="/Styles/Signup.css" media="all" rel="stylesheet" type="text/css"/> </head> but its still not working, I have created this Signup.css under a subdircetory called css so i tried "/css/signup.css" and "css/Signup.css" but that did not work either. In php admin page this css sheet shows under Styles so I tried "Styles/Signup.css" and "styles/Signup.css" but no luck
what php admin page? is this part of a cms or something like that possibly? either way the full url should work, and just in case, are you making sure the cases of the filenames/directories match? you have it mixed in your comments above so not sure. it's case sensitive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.