login about faq


hey i need help getting the php code below to align to the left can someone help? thanks

<meta http-equiv="refresh" content="45" />
<link rel="StyleSheet" href="style_public.css" type="text/css">
<?php require('djmessage_edit.php');?>
<?php
require('connect.php');
require('functions.php');
$ipaddr = $_SERVER['REMOTE_ADDR'];
$result = mysql_query("SELECT id, toip, message, fromdj, expire FROM rp_alerts") or die(mysql_error());
while($row = @mysql_fetch_array($result)) {
    if($row['expire'] <= date("G.i")) {
        $result = mysql_query("DELETE FROM rp_alerts WHERE id = '$row[id]'") or die(mysql_error());
    } else {
        if($row['expire'] > date("G.i")&&$toip == "ALL") {
            echo '<left>'. '<script language="JavaScript" type="text/javascript">
                alert("DJ '.$row['fromdj'].' Says: '.$row['message'].'")</script>';
        } else {
            if($row['toip'] == "ALL") {
                echo '<left>'. '<script language="JavaScript" type="text/javascript">
                    alert("DJ '.$row['fromdj'].' Says: '.$row['message'].'")</script>';
            } else {
                if($ipaddr == $row['toip']) {
                    echo '<left>'. '<script language="JavaScript" type="text/javascript">
                        alert("DJ '.$row['fromdj'].' Says: '.$row['message'].'")</script> ';
                        $result = mysql_query("DELETE FROM rp_alerts WHERE id = '$row[id]'") or die(mysql_error());
                }
            }
        }
    }
}
?>

asked Apr 21 '11 at 19:05

DJDhan's gravatar image

DJDhan
176353542

edited Apr 21 '11 at 19:10

eddieringle's gravatar image

eddieringle
2.3k71644

That's HTML code that your trying to align. PHP is what dynamically produces the HTML.

(Apr 23 '11 at 11:02) edgy edgy's gravatar image

Does this work?

<span style="float: left">

I am not a php expert.

answered Apr 21 '11 at 19:08

TheTechDude's gravatar image

TheTechDude
16.8k4094298

edited Apr 21 '11 at 19:08

What are you trying to align left? The JavaScript code produces alert boxes (not part of the web page). There is absolutely nothing printed to the web page itself that could be aligned.

However, if you did have text displayed on the page, for example:

<div>
   <p>Here's some text.</p>
</div>

You can align it using CSS:

<div style="text-align: center;">
    <p>Here's some center-aligned text.</p>
</div>

Left-aligned is default, by the way.

answered Apr 21 '11 at 19:15

eddieringle's gravatar image

eddieringle
2.3k71644

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported


Join Us in the Chat Room

Tags:

×974
×537
×171
×125
×95

Asked: Apr 21 '11 at 19:05

Seen: 2,644 times

Last updated: Apr 23 '11 at 11:02