Jump to content

sophie17117

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sophie17117's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Daft question now--- So if i replace all of my echo statements with $email_body .= 'whaterver' then include $email_body in my email sending bit, this should work??? even for tables? ???
  2. Okay so heres the dillio deal- I need to send the following code in an email...but its a mix of php and html, and it retrieves various values from a database before sending...oh and i wouldnt mind the sending of the mail to be done on a button click!...anyways i have messed and messed but i aint too sure whether it can be done! Can someone please tell me the code and where i need to place it within my code? :queasy: i'll post it all for whoever wants to take a look! Thank you in advance Ps...I know my code is off the wall, i'm like this when i java program too!! <html> <link rel='stylesheet' type='text/css' href='style.css'> <TITLE>Network Operation Centre Morning Bulletin- Preview Bulletin</TITLE> <img align="left" align="top" src="TMDicon.JPG" alt="Icon" width="189" height="39"> <H2>Trader Media Digital Network Operation Centre Morning Bulletin</H2> <body> </br> <?php $connect= mysql_connect('localhost','sophie-j','sophie'); if (!$connect) { echo("ERROR: Not connecting" . mysql_error() . "\n"); } mysql_select_db('sophie'); ?> <p align="center"><?php $day = date('l, '); $dtoday = date('Y-m-d'); $time = date('H:i:sa'); $timez = date('O T'); print "Date: $day $dtoday Time: $time. Time zone: $timez"; ?> </p> <h2><b>Trader Media Digital - Service Issues:</b></h2> <big><b> Current Service Issues: </b></big><br/> <b> Incidents: </b> The following services are unavailable or otherwise affected, as of 10:00 this morning:<br/><br/> <?php $result = mysql_query("SELECT * FROM bulletin_data WHERE `RepDate` = '$dtoday'"); echo "<table border='1' cellspacing='0' cellpadding='0'> <tr> <th><b><font color='darkblue'>Country</font></b></th> <th><b><font color='darkblue'>Service</font></b></th> <th><b><font color='darkblue'>Status Description</font></b></th> <th><b><font color='darkblue'>RefNo</font></b></th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td><font color='darkblue'>" . $row['Country'] . "</font></td>"; echo "<td><font color='darkblue'>" . $row['Service'] . "</font></td>"; echo "<td><font color='darkblue'>" . $row['StatusDesc'] . "</font></td>"; echo "<td><font color='darkblue'>" . $row['RefNo'] . "</font></td>"; echo "</tr>"; } echo "</table>"; echo "</table>"; echo "</br>"; echo "<big><b>Historic service issues:</b></big></br>"; echo "Listed below are significant incidents encountered in the last 24 hrs that have been resolved:<br/><br/>"; $results = mysql_query("SELECT * FROM bulletin_data WHERE `RepDate` = '$dtoday'"); echo "<table border='1' cellspacing='0' cellpadding='0'> <tr> <th><b><font color='darkblue'>Country</font></b></th> <th><b><font color='darkblue'>Service</font></b></th> <th><b><font color='darkblue'>Summary</font></b></th> <th><b><font color='darkblue'>Impact</font></b></th> <th><b><font color='darkblue'>Time Period</font></b></th> <th><b><font color='darkblue'>PastRefNo</font></b></th> </tr>"; while($row = mysql_fetch_array($results)) { echo "<tr>"; echo "<td><font color='darkblue'>" . $row['PastCountry'] . "</font></td>"; echo "<td><font color='darkblue'>" . $row['PastService'] . "</font></td>"; echo "<td><font color='darkblue'>" . $row['IssueSummary'] . "</font></td>"; echo "<td><font color='darkblue'>" . $row['IssueImpact'] . "</font></td>"; echo "<td><font color='darkblue'>" . $row['TimePeriod'] . "</font></td>"; echo "<td><font color='darkblue'>" . $row['PastRefNo'] . "</font></td>"; echo "</tr>"; } echo "</table>"; echo "</br><br/>"; echo "<h2><b>Trader Media Digital - NOC News:</b></h2>"; echo "<b><big>Deployments and Maintenance News for Today:</big></b><br/>"; echo "<br/><b><font color='red'>Service Affecting Deployments and Maintenance</font></b>"; $todayd = date('Y-m-d'); $resul = mysql_query("SELECT * FROM `bulletin_data` WHERE `RepDate` = '$todayd' AND `ServiceAffect` !=('NULL')"); echo "<table border='0'>"; while($row = mysql_fetch_array($resul)) { echo "<tr>"; echo "<td><font color='red'>". $row['ServiceAffect']."</font></td>"; echo "</tr>"; } echo "</table>"; echo "<br/><b><font color='darkblue'>Non-Service Affecting Deployments and Maintenance</font></b>"; $todaydy = date('Y-m-d'); $res = mysql_query("SELECT * FROM bulletin_data WHERE `RepDate` = '$todaydy' AND `NonServiceAffect` !=('NULL')"); echo "<table border='0'>"; while($row = mysql_fetch_array($res)) { echo "<tr>"; echo "<td><font color='darkblue'>". $row['NonServiceAffect']."</font></td>"; echo "</tr>"; } echo "</table>"; echo "<br/><br/><b><big>Deployments and Maintenance News for Tomorrow:</big></b><br/>"; echo "<br/><b><font color='red'>Service Affecting Deployments and Maintenance</font></b>"; $dytoday = date('Y-m-d'); $reslt = mysql_query("SELECT * FROM bulletin_data WHERE `RepDate` = '$dytoday' AND `ServAffectTomrw` !=('NULL')"); echo "<table border='0'>"; while($row = mysql_fetch_array($reslt)) { echo "<tr>"; echo "<td><font color='red'>". $row['ServAffectTomrw']."</font></td>"; echo "</tr>"; } echo "</table>"; echo "<br/><b><font color='darkblue'>Non-Service Affecting Deployments and Maintenance</b></font>"; $todayday = date('Y-m-d'); $resu = mysql_query("SELECT * FROM bulletin_data WHERE `RepDate` = '$todayday' AND `NonServAffectTomrw` !=('NULL')"); echo "<table border='0'>"; while($row = mysql_fetch_array($resu)) { echo "<tr>"; echo "<td><font color='darkblue'>". $row['NonServAffectTomrw']."</font></td>"; echo "</tr>"; } echo "</table>"; echo "<p align='center'>Click 'Return' to go back and enter more data or click 'Send' to send the NOC Bulletin via e-mail.</p>"; echo "<p align='center'><input type='button' value='Return' onClick=\"window.location='http://nlwapp103/nocapps/sophie/'\">"; echo "<p align='center'><input type='button' value='Send' onClick='\"window.location='http://nlwapp103/nocapps/sophie/'\">"; msql_close($connection); ?> </body>[color=black][/color] </html>
  3. ive had insider help!!! i'm inserting all of my array data into separate tables into my database linking them using join now. I dare say i'll hit another problem soon thanks
  4. I have got it to print all the values to screen its just inserting them into my database. This is the code section in the index- <tr><td><select multiple align= "left" name="country[]" size="2"> <option>IE</option> <option>NL</option> <option>UK</option> <option>ZA</option> </select></td> then i have a page called issue, which just prints out the users selection to the screen and then inserts it into the database- $countries[]=<?php foreach($country as $value)echo "$value."; ?><br /> insert bit- <?php $connect= mysql_connect('localhost','',''); if (!$connect) { echo("ERROR: Not connecting" . mysql_error() . "\n"); } mysql_select_db('sophie'); ?> <?php $insert = "INSERT INTO bulletin_data (RepDate, RepTime, Country, Service, StatusDesc, RefNo) VALUES ('$today','$time','$countries', '$services', '$status', '$refno')"; MYSQL_QUERY($insert) or die(mysql_error()); msql_close($connection); ?> when i call my insert statement i call $countries should i be using $country?
  5. I'm trying to loop through values and insert them into $countries so that i can put $countries into a database field. :-\ at the moment i have a preview page that, once in my index page i have selected multiple options in a menu, the user submitts and the preview page prints the multiple selections using <?php foreach($country as $value)echo "$value."; ?><br /> i now need to put all those $values into one $countries array by looping through, but...i'm being blonde and really cant do it even though i no its simple!!! Students eigh!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.