PHP - Override Css On An Echo
I have a function which echos an array output, which creates links on a page related to that page. It all works well, but the CSS is making the links blue and purple as standard, and I want to overwrite this to make the links white. What can I add to the code to overwrite the style of the echo? The font size is working, but the colour is being overridden. The code I currently have is: echo "<p> <font color='ffffff' size='4pt'>$echo</font></p>";
What am I doing wrong? Similar TutorialsOK, have no idea what's going on... I've done this a million times... why wont this output!?? I must have a major brain meltdown and dont know it yet!!! Code: [Select] <?php // this echoes just fine: echo $_POST['testfield']; // but this wont echo: echo if (isset($_POST['testfield'])) { $_POST['testfield'] = $test; } echo $test; /// or even this DOESNT echo either!: $_POST['testfield'] = $test; echo $test; ?> What other ways are there of redirecting to a different page, other than the standard Code: [Select] <meta HTTP-EQUIV="REFRESH" content="3; ... Ways that cannot be prevented by browsers? I need to add more code to an existing function located inside the parent class. I'm using code like this but can't get it working :
// Parent class Default_Fields { public function fields() { $this->_fields = array() // Default Code } } // Child class More_Fields extends Default_Fields { public function fields() { $this->_fields = array() // Modified Code } } $new = new More_Fields; $new->fields();
Do any of you know how to override the php.ini file on a webhost to allow uploads using php to be set for 2gig mx file size? .htaccess is not working and my host says it supports changing the php.ini but nothing seems to be working. Hi guys, I'm sending mail from php running on a cheap webhost with the following: Code: [Select] $to = 'name@domain.com.au'; $header = 'MIME-Version: 1.0' . "\r\n"; $header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $header .= "From: Name <noreply@domain.info>" . "\r\n"; $subject = "Interest registered"; $message = "<!DOCTYPE HTML.. a bunch of html"; mail($to, $subject, $message, $header); As you can see I've set "from" in the headers. When I receive the email however, it says from: myusername@my.cheaphost.com on behalf of Name [noreply@domain.info] I need to get rid of the on behalf bit as it looks completely unprofessional. I just want it to say from: Name [noreply@domain.info] Obviously this is probably something to do with the setup of the server, some of which I have no control over. I have access to another mail server which I can use to send email, so I put this at the start of my code: Code: [Select] ini_set('SMTP', 'mail.myotherserver.com.au'); echo ini_get('SMTP'); Which returns mail.myotherserver.com.au however, when I use the mail function, it still comes from myusername@my.cheaphost.com on behalf of Name [noreply@domain.info] Is there something I'm missing, is the mail function not tied to the SMTP value? Thanks This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=343981.0 Hi there,
I have a timetable plugin that shows booking entries.
The times are generated dynamically by the plugin.
Now I have the situation where I need to override the automatically created time that shows in a table row.
Here's the HTML code generated by the plugin:
<tr class="row_12"> <td class="tt_hours_column">00:00</td>Ist it possible to have a simple PHP script that does the following (please forgive my noobiness) ? if table row is "row_12" then insert "my own pre-defined time" Please don't hate on me, I know I have not the slightest idea about php. I'm just wondering how to solve my plugin problem and if PHP is the right way to do it. I highly appreciate any feedback from you guys Hi All, I'm trying to echo the response from an SLA query, the query works and returns the data when I test it on an SQL application.. but when I run it on my webpage it won't echo the result. Please help? <?php $mysqli = mysqli_connect("removed", "removed", "removed", "removed"); $sql = "SELECT posts.message FROM posts INNER JOIN threads ON posts.pid=threads.firstpost WHERE threads.firstpost='1'"; $result = mysqli_query($mysqli, $sql); echo {$result['message']}; ?> I have a log system that allows 10 logs on each side(Left and right). I am trying to make it so that the left side has the 10 most recent logs, then the right as the next 10. Any ideas? So I need to echo a row from my database with php, but where i need to echo is already inside an echo. This is my part of my code: $con = mysql_connect("$host","$username","$password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("main", $con); $result = mysql_query("SELECT * FROM Vendor"); while($row = mysql_fetch_array($result)) { //I need to echo right here .................. but I get a blank page when I try this. Please Help. echo '<option value=$row['vendor_id']>'; echo $row['vendor_id']; echo '</option>'; } mysql_close($con); Result: A Blank page. Thanks in advance! Hi
I try to echo out random lines of a html file and want after submit password to whole content of the same html file. I have two Problems.
1st Problem When I echo out the random lines of the html file I don't get just the text but the code of the html file as well. I don't want that. I just want the text. How to do that?
for($x = 1;$x<=40;$x++) { $lines = file("$filename.html"); echo $lines[rand(0, count($lines)-1)]."<br>"; }I tried instead of "file("$filename.html");" "readfile("$filename.html");" But then I get the random lines plus the whole content. Is there anything else I can use instead of file so that I get the random lines of text without the html code?P.S file_get_contents doesn't work either have tried that one. 2nd Problem: As you could see in my first problem I have a file called $filename.html. After I submit the value of a password I want the whole content. But it is like the program did forget what $filename.html is. How can I make the program remember what $filename.html is? Or with other words how to get the whole content of the html file? My code: if($_POST['submitPasswordIT']){ if ($_POST['passIT']== $password ){ $my_file = file_get_contents("$filename.html"); echo $my_file; } else{ echo "You entered wrong password"; } }If the password isn't correct I get: You entered wrong password. If the password is correct I get nothing. I probably need to create a path to the file "$filename.html", but I don't know exactly how to do that. I want to echo this div below but only if there is more than one of these fields missing. How would I go about this? <?php //only echo all of this if one or more of these fields does not exists so....... if () { echo" <div id=\"items_todo\"> <h3>Members Info</h3><br/> <ul>"; if (empty($User['address_L1'])) { echo "<li><a href=\"#\">Update Address</a></li>";} elseif (empty($User['intro'])) {echo "<li><a href=\"#\">About You</a></li>";} elseif (empty($User['profile_image'])){echo "<li><a href=\"#\">Add Profile Image</a></li>";} elseif (empty($User['Nickname'])){echo "<li><a href=\"#\">Add A Nickname</a></li>";} echo"</ul> </div>"; } ?> Hi freaks, Yes im a noob... I have some data in a db that im echoing out, but the last row wont multiply? The rest works great... I have tried having the data as the following: 1.12 or 0.12 & I have tried having it as a var. Do I need to have a % in there somewhere? Im adding up all the data then I want to multiply by 12% (*$row['markup']) <?php echo $row['Stock1']*$row['qty']+$row['cutting']+$row['production']+$row['additional']+$row['pluscover']+$row['selfcover']*$row['markup'];?> any help would be appreciated. cuzzmunger. I saw that <?=$var?> instead of <?php echo $var; ?> can be used for echo, does it work on every server? Hi, I can't figure out how to echo <br/> after 14 characters every line from text. Any idea's? Cyto Hi Freaks, You guys helped me yesterday & now I have expanded on what I was doing & now need more help. From my limited knowledge I'm trying to add theses strings together. (I'm a printer) Its all adding up correctly until the end. *$row['markup'] is only multiplying the last string and not the complete echo...I have indicated the last string in blue. <?php echo ($row['laminating']*$row['qty'])+($row['Stock1']*$row['qty'])+($row['cutting']+$row['production']+$row['additional']+$row['pluscover']+$row['selfcover'])*$row['markup'];?> What I need to do is add up everything in red and * by my markup value (12%) <?php echo ($row['laminating']*$row['qty'])+($row['Stock1']*$row['qty'])+($row['cutting']+$row['production']+$row['additional']+$row['pluscover']+$row['selfcover'])*$row['markup'];?> any help would be appreciated! cuzzmunger Hi I once found out how to do this 4 years ago but I lost my backups and memory on the matter. I want this xml to be echoed? out as it is. When I try the standard echo and print, I get the first two lines of the code in gray when I view the page's source. I get no xml at all. Code: [Select] <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE blah [ <!ELEMENT cart (title, items)> <!ELEMENT title (#PCDATA)> <!ELEMENT items (item)+> <!ELEMENT item (prive, deprive, onprive+)> <!ELEMENT security (#PCDATA)> <!ELEMENT answer (#PCDATA)> <!ATTLIST answer correct (yeah) #IMPLIED> ]> this is followed by the standard displaying of xml items could anyone help me over here? thanks in advance... Code: [Select] <?php $sum_num = mysql_query("SELECT SUM(likes) as totallikes FROM facebook"); echo $sum_num; ?> i got this result Resource id #27 how to get a number only? What is the correct way to write an if/else statement within an echo? I need to alter this so that I can query to see what data is found and if not correct not to echo the rest of the statement. Code: [Select] echo '<td class="productbox"> <h1>' . $product_title . '</h1> </td>'; So from the above code which is echoed within the single quotes, what is the correct way to include an if else check on a value from the database. I know how its done, but just want to save time and write it the correct way within this. |