Jump to content

PHPremote

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by PHPremote

  1. Does the namespace text HAVE to take the form of a url?

    Since a namespace is just intended as a text identifier should another section of XML be used in the same webpage (such as different XML markup languages or those being called from different scripts) can another form for the namespace text be used, such as an email address or something else that should be unique? If all the sources are from a single website, they can be tracked and a unique identifier name assigned to them like "identifier1" and "identifier2" .

  2. I suspect in your file you are using "border-radius:20;" in the CSS for each text element in the menu. I haven't tested it now,  The vertical margins are likely too small. Maybe "margin:40px 0px;" or "margin-top,margin-bottom:40px;" .

    To ensure the display as block elements, you could also try an unordered list with "text-decoration:none;" . The list elements default to "display:block;" .

  3. Why does my polyline tag in SVG not accept style set inside defs tag but does in normal CSS?

    Here is my code: 

    <html>
    <body>
    
    <style>
     .trapezoid2 { fill:beige;stroke:forestgreen;stroke-width:2; }
    </style>
    
    <center> <!-- I routinely use the center tag for older browsers. -->
    
    <svg height="400" width="800" style="border:5px double blue;background-color:tan;margin:0 auto;" >
      <defs>
            <polygon id="trapezoid1" style="fill:tan;stroke:blue;stroke-width:4;" />
      </defs>
        
         <use xlink:href="#trapezoid1" points="100,200 150,100 350,100 400,200" />
         
         <polygon id=".trapezoid2" points="400,300 450,200 650,200 700,300" style="fill:beige;stroke:forestgreen;stroke-width:2;" />
    </svg>
    
    </center>
    </body>
    </html>

    The second trapezoid shows up but not the first.

    Thanks,

    PHPremote aka Patrick

     

     

    w3forum_polyline_defJune3.html

  4. Could you submit some or your relevant code?

    Try

    Quote

    <html>
    <body>
    <center>
    <svg style="border:5px solid blue;background-color:tan;margin:0 auto;" height="100" width="100">
        <circle cx="50" cy="50" r="40" style="fill:white;stroke:blue;stroke-width:10;" />
    </svg>
    </center>
    </body>
    </html>

     

    The result is shown in the attached html file. w3forum_cirrle_rajatporwalJune3.html

  5. My code here works in some locations but not others. I believe it may be due to a faulty database connection. The $dbconnection gets returned from a function intended for the purpose and then passed to functions as needed.

    I am getting this error message for a $conn->query("SELECT * FROM formstable"); :

    Quote

    Warning: mysqli::query(): Couldn't fetch mysqli in C:\xampp\htdocs\ ...

    (The warning goes on to specify the page and line number of course.)

    The code works within the database connection function just before my "return $conn;" statement.

    It works within a function "askQuery" called from one location but not anorher.

    It does not work at all in a function "showSelect".

     

    This seems the most relevant code:
     

        $newsqlStatement = showSelect($testConn, "SELECT * FROM formstable"); // will later isolate selectStatement WHERE formname = formname
    
    function showSelect($conn, $sqlStatement) {
    
                $result = $conn->query("SELECT * FROM formstable");
    
    .
    
    '
    
    '
    
        return $successSelect; // for now just true or false
    } // end function showSelect

     

     

  6. The following standard code is not allowing access to the MySQL database indicated:

    	// declare database validation variables
    	$servername = "localhost";
    	$username = "toughnerd";
    	$password = "frustrated";
    	$dbname = "workforaliving2";
    
    	// Create connection
    	$conn = new mysqli($servername, $username, $password, $dbname);
    
    	// Check connection
    	if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    	}
    		echo "Connected successfully";

    Here is the error message:

    Quote

    Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'toughnerd'@'localhost' (using password: YES) in C:\xampp\htdocs\frameworkinphpsauce\testingOfFramework\askQuery_function.php on line 43
    Connection failed: Access denied for user 'toughnerd'@'localhost' (using password: YES)

    The server name, username, password, and database name are correct, defined in phpAdmin as needed.

    I do understand that "(using password: YES)" just means a password is being used.

     

  7. Apparently, I have a line break within my innerHTML in a span tag with id=accountPanelTxt .

    I have to add a line break in a variable I am testing, as shown here.

    Quote

    if (x == '\ntrue') {

     

    This is the resulting HTML, before the username innerHTML is altered:

    <span id="accountPanelTxt">
    true</span>
    
    <span id="usernameTxt">
    morenuts3</span>

     

    This is the Javascript:

    <script>
    alert("got here1b");
    alert(document.getElementById("accountPanelTxt").innerHTML);
    loggedIn = document.getElementById("accountPanelTxt").innerHTML;
    alert("logged in: "+loggedIn);
    
    alert(document.getElementById("usernameTxt").innerHTML);
    var userName = document.getElementById("usernameTxt").innerHTML;
    alert("userName: "+userName);
    
    alert(document.getElementById("accountPanel").innerHTML);
    
    x = document.getElementById("accountPanelTxt").innerHTML;
    alert("x: "+x);
    
    z = 'true';
    alert("z: "+z);
    
    y ='';
    menuTxt = '';
    
    if (x == '\ntrue') {
    	y = "T";
    		menuTxt = '<div class="dropdown"><button class="dropbtn">'+userName+'</button><div class="dropdowncontent"><a href="#">My Account</a><a href="#">My profile</a><a href="#">Profile Settings</a><a href="#">Notifications</a><br><a href="logout.php">Logout</a></div></div>';
    } else {
    	y= "F";
    	menuTxt = '<a href="indextemplate.php" id="loginlink">Login</a></td><td><a href="indextemplate.php" id="loginlink">Register</a>';
    }
    alert(y);
    alert(menuTxt);
    document.getElementById("accountPanelTxt").innerHTML = menuTxt;
    
    alert("got here2b");
    </script>
    

     

  8. I need an overall algorithm or sequence for login test using sessions. I am all turned around. I had to make up my own flowchart on paper.

    To access the username, for example, once the user is already logged in, I put a session_start() at the beginning of the site header script, called from within a page like "search.php". But to log in or out, I need to access it before that. I think I need to put session_start() at the beginning of each individual page.

    Passing variables like SESSION['validlogin'] seems to be haphazard, but I think that is a logic error somewhere.

    I was trying to make it really elegant before, with a single redirection script once logged in, but that was not working. So, back to basics.

×
×
  • Create New...