Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7643947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:34:13+00:00 2026-05-31T09:34:13+00:00

I am learning PHP by myself and I wonder if you guys can help

  • 0

I am learning PHP by myself and I wonder if you guys can help me to solve my problem. I want to concatenate 2 variables that are align right in the form of an hyperlink with a word. I can do that no problem, but the word is not getting aligned right as well. I have tried somethings, but it doesnt work. Please see my code:

<?php
     $log = ( '<a style="float:right; "href="login.php">login </a>'  ) ;
     $reg = ( '<a style="float:right; "href="login.php">register </a>' );
     echo $log ." or " .  $reg;
?>

I need login or register to be displayed on the top right of the page, but I dont want to hyperlink the word “or”.
Also, if you guys have any links for good tutorials on PHP or tutorials on how to create a good website design, maybe templates, please paste here. I am starting with websites now and I am learning by myself. Any help is appreciatted. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:34:14+00:00Added an answer on May 31, 2026 at 9:34 am

    You probably are thinking wrong in terms of HTML/CSS markup. HTML code that will be generated by your script looks as follows:

    <a style="float:right; "href="login.php">login </a> or <a style="float:right; "href="login.php">register </a>
    

    It will first float “login” to the right, then append “register” to the left of “login”.
    I would suggest doing it this way:

    <?php
        $log = '<a href="login.php">login </a>';
        $reg = '<a href="login.php">register </a>';
        echo sprintf("<div style='float:right;'>%s or %s</div>", $log, $reg);
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As a fun side-project for myself to help in learning yet another PHP MVC
I am learning PHP by myself for doing my final year project, but I
I have recently got myself into learning PHP. I have a mac and the
I am new to PHP but learning slowly. Problem I have is including Google
I'm learning web-centric programming by writing myself a blog, using PHP with a MySQL
i want to write modules by myself very much. but for drupal and php,
Just learning PHP and I'm having some trouble understanding mysql_query. My understanding is that
So, I started learning PHP. It turned out that I need local server or
I am currently learning PHP and I want to start incorporating Facebook basic elements
been learning php for 3 weeks now and i find myself with a simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.