Jump to content

gwolff2005

Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by gwolff2005

  1. Hi guys, I need your help. My website was working fine. On my page (guntmarwolff.com) I have amongst other things a small teaser for my wordpress blog (left bottom) (which is on another site). As I said everything is working fine, Then I installed wp touch on my blog site ( a plugin which detects if a mobile device enters the blog page). Since then I get this error message. Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/w010930a/index.php:3) in /www/htdocs/w010930a/blog/wp-content/plugins/wptouch/core/class-wptouch-pro.php on line 404 When I deactivate the plugin the error message is gone.But for obvious reasons I need teh plugin. So what do I need to do. Tried already to delete all empty spaces. Did not help. Funny thing. While writing this, the error is gone in firefox but still there in chrome and IE. The error was as well shown to me yesterday evening and then after refreshing it dissappear until this morning... But at the same time the error is shown on other devices as well. So it is not because of my settings. Here is the code around index.php:3 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <?php if(isset($_GET['mVar'])){ session_start(); $_SESSION['views']=1; // Declaring a session to track the visits } if(!$_SESSION['views'] == 1){ // Checking the session and doing the redirection and here is the code around class-wptouch-pro.php:404 } } if ( !isset( $_COOKIE[ WPTOUCH_CACHE_COOKIE ] ) || ( isset( $_COOKIE[ WPTOUCH_CACHE_COOKIE ] ) && $_COOKIE[ WPTOUCH_CACHE_COOKIE] != $cookie_value ) ) {setcookie( WPTOUCH_CACHE_COOKIE, $cookie_value, time() + 3600, '/' ); $_COOKIE[ WPTOUCH_CACHE_COOKIE ] = $cookie_value; } if ( !is_admin() ) { do_action( 'wptouch_cache_page' ); } } Thnaks so much in advance for your help.
  2. @ Mancent. Thanks for the code. I will try it now. I have the popupbox.htm. @Skunkbad: Some of it I pull over from my normal site so I dont have to maintain too much...
  3. Thanks for your input @ ginerjm How would I start the session first, if I want to detect First if it is mobile or not and if yes redirect. If that is not necessary how owuld I code it then? @Mancent: My problem is that the window does not pop up in my code which it is supposed to do.
  4. Hi guys, I need your help, I am very desperate. I want people visitng my site with a mobile browser seeing a window saying, would you liek to switch to mobile view? - and the redirect. I found this code and I tried to implement it in my php fiel but nothing changes. Mobile borwser goes immediately to mobile view without window asking first, * What am I missing or doing wrong. you can test it out on guntmarwolffdotcom Thanks for your help! <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <?php if(isset($_GET['mVar'])){ session_start(); $_SESSION['views']=1; // Declaring a session to track the visits } if(!$_SESSION['views'] == 1){ // Checking the session and doing the redirection if ($_SERVER["QUERY_STRING"] == null){ echo " <script type=\"text/javascript\"> if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { window.location.replace('http://m.guntmarwolff.com');} </script> "; } } ?> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script> <!-- Add fancyBox main JS and CSS files --> <script type="text/javascript" src="http://www.guntmarwolff.com/fancyapps-fancyBox-v2.1.5-0-ge2248f4/source/jquery.fancybox.js"></script> <link rel="stylesheet" type="text/css" href="http://www.guntmarwolff.com/fancyapps-fancyBox-v2.1.5-0-ge2248f4/source/jquery.fancybox.css" media="screen" /> <script type="text/javascript" jQuery(document).ready(function () { jQuery.fancybox({ 'width': '75%', //Use percentage to maintain responsiveness 'height': '75%', 'autoScale': true, 'transitionIn': 'fade', 'transitionOut': 'fade', 'type': 'iframe', 'href': 'popupbox.htm' }); }); </script>
  5. Hi guys thanks for your help. my divs were quite a mess. So I took the div completely out and voila... Thanks again!!
  6. Hi guys, I need your help please. i worked on my site and everything looks fine apart from two divs. They appear in IE and FF fine but not in Chrome (see picture attached). First picture show in FF and IE which is correct the second one in chrome. The red CIRCLES (not the square) are the problems. The code for the facebook div is: <div class="fb-share-button" div style="position:relative;top:-50px;left:690px;z-index:4; width:345px; float:right;" data-href="http://www.guntmarwolff.com" data-type="button_count"></div> </div> The code for the picture div is: <div style="position:relative;top:85px;left:0px;z-index:5000px;"><script type="text/javascript"> var imlocation = "images/"; var currentdate = 0; var image_number = 0; function ImageArray (n) { this.length = n; for (var i =1; i <= n; i++) { this[i] = ' ' } } image = new ImageArray(3) image[0] = 'main_ad3.jpg' image[1] = 'main_ad4.jpg' image[2] = 'main_ad5.jpg' var rand = 60/image.length function randomimage() { currentdate = new Date() image_number = currentdate.getSeconds() image_number = Math.floor(image_number/rand) return(image[image_number]) } document.write("<img src='" + imlocation + randomimage()+ "'>"); </script></div> What am I doing wrong????? Please help. Thanks!!!!
  7. Hey it works!!!!! Thank you very much!!!!!!! I really appreciate your help. Thank you!
  8. Hi mr Marcus, I did that, godaddy seems to have a mailqueue again, so I cannot see teh results right now. I will let you know as soon as I get the mail. Hopefully it works. Thank you so much.
  9. Hi Mr. Marcus, What do I need to write in order to add it to the mail function. I am on this the whole day already and cannot get it sorted. Thank you so much!!
  10. mrMarcus, I am quite a php beginner, so the only thing I can say: that putting all bits and pieces together it does not show the iP. What do I need to add/change in order for it to works. I really appreciate your help. Thank you.
  11. mrMarcus, kicken, thanks for your help. It is still not sending me the IP In the enmail I get it just says Ip and then blank... while on the internet it shows the ip address.
  12. Hi guys. I need your help. I have a contact form, on which the ip address is shown, but it does not get send with the form, for whatever reason... What am I doing wrong?? Thanks for your help!!! <?php // wenn das Formular übermittelt wurde if(isset($_POST['abschicken'])){ while(list($feld,$wert)=each($_POST)){ // übermittelte Inhalte "entschärfen" $wert=preg_replace("/(content-type:|bcc:|cc:|to:|from:)/im", "",$wert); $feld=$wert; // die übermittelten Variablen werden zum "Text der Email" zusammengefasst if($feld!="abschicken") $mailnachricht.=ucfirst($feld).": $wert\n"; } $mailnachricht.="\nDatum/Zeit: ". date("d.m.Y H:i:s"); $ip=@$REMOTE_ADDR; echo "<input type='hidden' value='$ip' />"; // Ãœberprüfen ob alle Pflichtfelder gefüllt sind empty($vorname) ? $err[] = "<p>- Bitte den Vornamen angeben.</p>" : false; empty($email) ? $err[] = "<p>- Bitte die Email-Adresse angeben.</p>" : false; empty($text) ? $err[] = "<p>- Welchen Wunsch haben Sie? Bitte den Text eingeben.</p>" : false; // wenn nicht, werden die Fehlermeldungen ausgegeben und das "halbgefüllte" Formular angezeigt if(!empty($err)) { echo "<p>Bitte korrigieren Sie folgende Fehler:</p>"; foreach($err as $fehler){ echo $fehler; } ?> <form action="<?php echo $_SERVER['kontakt/PHP_SELF']; ?>" method="post"> <table width="100%" border="0" cellpadding="3" cellspacing="1"> <tr> <td width="140" align="right" class="style18"><div align="left" class="style22">Nachname:</div></td> <td align="left"><input type="text" name="nachname" value="<?php echo $nachname; ?>" style="width:100%;" /></td> </tr> <tr> <td align="right" class="style18"><div align="left" class="style22">Vorname:</div></td> <td align="left"><input type="text" name="vorname" value="<?php echo $vorname; ?>" style="width:100%" /></td> </tr> <tr> <td align="right" class="style18"><div align="left">Firma:</div></td> <td align="left"><input type="text" name="firma" value="<?php echo $firma; ?>" style="width:100%" /></td> </tr> <tr> <td align="right" class="style18"><div align="left">Postanschrift:</div></td> <td align="left"><input type="text" name="strasse" value="<?php echo $strasse; ?>" style="width:100%" /></td> </tr> <tr> <td align="right" class="style18"><div align="left">Telefon:</div></td> <td align="left"><input type="text" name="telefon" value="<?php echo $telefon; ?>" style="width:100%" /></td> </tr> <tr> <td align="right" class="style18"><div align="left" class="style22">E-Mail:</div></td> <td align="left"><input type="text" name="email" value="<?php echo $email; ?>" style="width:100%" /></td> </tr> <tr> <td align="right" class="style18"><div align="left">Ihre IP Adresse</div></td> <td align="left"><input type="hidden" name="ip" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" style="width:100%" /></td> </tr> <tr> <td colspan="2"><textarea rows="12" style="width:100%" name="text"><?php echo $text; ?></textarea></td> <td></td> </tr> <tr> <td colspan="2" align="left" nowrap><input name="reset" type="reset" style="width:49%" value="Formular löschen" /> <input type="submit" name="abschicken" class="button" value="Formular absenden" style="width:49%" /></td> </tr> </table> <?php // sind keine Fehler vorhanden, wird die Email versendet } else { $mailbetreff="Kontaktformular ".$_SERVER['HTTP_HOST']; // HIER DIE EMPFÄNGER EMAIL-ADRESSE ANPASSEN!!! echo (mail("guntmar@guntmarwolff.com", $mailbetreff, $mailnachricht, "From: $email")) ? "<p>Vielen Dank für Ihre Email.</p>": "<p>Ein Fehler ist aufgetreten!</p>"; ; } // das Formular welches als erstes dem Besucher angezeigt wird } else { ?> </form> <form action="<?php echo $_SERVER['kontakt/PHP_SELF']; ?>" method="post"> <table width="100%" border="0" cellpadding="3" cellspacing="1"> <tr> <td width="140" align="right" class="style18"><div align="left" class="style22">Nachname:</div></td> <td align="left"><input type="text" name="nachname2" value="" style="width:100%;" /></td> </tr> <tr> <td align="right" class="style18"><div align="left" class="style22">Vorname:</div></td> <td align="left"><input type="text" name="vorname" value="" style="width:100%" /></td> </tr> <tr> <td align="right" class="style18"><div align="left">Firma:</div></td> <td align="left"><input type="text" name="firma" value="" style="width:100%" /></td> </tr> <tr> <td align="right" class="style18"><div align="left">Postanschrift:</div></td> <td align="left"><input type="text" name="strasse" value="" style="width:100%" /></td> </tr> <tr> <td align="right" class="style18"><div align="left">Telefon:</div></td> <td align="left"><input type="text" name="telefon" value="" style="width:100%" /></td> </tr> <tr> <td align="right" class="style18"><div align="left" class="style22">E-Mail:</div></td> <td align="left"><input type="text" name="email" value="" style="width:100%" /></td> </tr> <tr> <td align="right" class="style18"><div align="left">Ihre Ip Adresse:</div></td> <td align="left"><input type="hidden" name="ip" value="" class="style18"> <span class="style18"><?php echo $_SERVER['REMOTE_ADDR']; ?></span></td> </tr> <tr> <td colspan="2"><textarea rows="12" style="width:100%" name="text"></textarea></td> <td></td> </tr> <tr> <td colspan="2" align="left" nowrap><input name="reset" type="reset" style="width:49%" value="Formular löschen" /> <input type="submit" name="abschicken" value="Formular absenden" style="width:49%" /></td> </tr> </table> <!-- bitte lassen Sie diesen Link sichtbar auf Ihrer Seite. Danke! --> <?php } ?> </form> </div>
  13. Hi, I am writing a code in PHP to achieve the date recurrence pattern just like in Microsoft Outlook in Codeigniter Framework. The logic is a course starts every week or every month or yearly. When admin selects current date and weekly or month in the form, it should calculate and return all the rows as output. For example if user say that course starts every week on Monday and occurrence as 20, it should return 20 rows with starting and ending date with course name. For which I created a form with fields: start date, end date and recurrence: weekly monday, tuesday, wednesday, thursday, friday: monthly: yearly and occurrence (please the attach image). and inserted this values into the Mysql database table. I need some help to start with writing the logic to retrieve all the rows with course name with start and end date the values back to user. Thanks in advance! [attachment deleted by admin]
  14. Hi guys, I have an entry site with six fields, (country, town, school, language, course type, starting date) all of them take their content from the database. (Just those countries will be shown, if someone registered from there) However, if a visitor chooses e.g. country USA, and then schools, he will still be shown ALL schools, no matter if they are in the USA or not. I need to change that! How can I make the fields dependent from each other. So if a visitor chooses a country, that just the schools, the towns, the courses, etc.. will be shown in the other drop down menus from that particular country. Thanks! Here is my code: <style type="text/css"> .search_panel { width: 250px; margin: 10px 0; } .search_panel input { width: 220px; border: 2px solid #000643; padding: 5px; } .search_panel select { width: 230px; border: 2px solid #000643; padding: 5px; } </style> <script> $(function() { $( "#course_start_date" ).datepicker(); }); </script> <div id="home"> <div style="width: 500px; height:260px; padding: 40px 50px; margin: 0 auto; background-image: url(<?=base_url()?>images/front_blue.png); background-repeat: no-repeat;"> <form method="post" action="<?=site_url('search')?>"> <div class="search_panel" style="float: left;"> <select name="country" style=""> <option value="">Choose a country</option> <?php if($countries): foreach($countries as $country): ?> <option value="<?=$country->school_country?>"><?=$country->school_country?></option> <?php endforeach; endif; ?> </select> </div> <div class="search_panel" style="float: left;"> <select name="city"> <option value="">Choose a city</option> <?php if($cities): foreach($cities as $city): ?> <option value="<?=$city->school_city?>"><?=$city->school_city?></option> <?php endforeach; endif; ?> </select> </div> <br clear="all"/> <div class="search_panel" style="float: left;"> <input type="text" name="starting_date" id="course_start_date" value="Choose a starting date" onclick="this.value='';"/> </div> <div class="search_panel" style="float: left;"> <select name="course_type"> <option value="">Course type</option> <?php if($course_types): foreach($course_types as $course_type): ?> <option value="<?=$course_type->course_type?>"><?=$course_type->course_type?></option> <?php endforeach; endif; ?> </select> </div> <br clear="all"/> <div class="search_panel" style="float: left;"> <select name="school_name"> <option value="">Search by school name</option> <?php if($schools): foreach($schools as $school): ?> <option value="<?=$school->school_name?>"><?=$school->school_name?></option> <?php endforeach; endif; ?> </select> </div> <div class="search_panel" style="float: left;"> <select name="language"> <option value="">Search by language</option> <?php if($languages): foreach($languages as $language): ?> <option value="<?=$language?>"><?=$language?></option> <?php endforeach; endif; ?> </select> </div> <br clear="all"/> <center> <p><br /> <input type="image" src="<?=base_url()?>images/search.png"/> </p> </center> </form> </div> </div>
  15. Hi I have the file "pback.php" which displays a mysql table. One row allows me to update the data. If I press "update it leads me to update.php, but there I just get white fields instead of the data from the id requested. If I type anything in the field and press confirm it opens update_ac but just says error. What do I do wrong? Thanks! <?php $host="xxx"; // Host name $username="xxx"; // Mysql username $password="xxx"; // Mysql password $db_name="xxx"; // Database name $tbl_name="sp_users"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); //$sql="SELECT * FROM $tbl_name ORDER BY user_id"; $sql="SELECT * from sp_users,sp_schools where sp_users.user_id=sp_schools.school_id ORDER BY school_name"; $result=mysql_query($sql); $num_rows=mysql_num_rows($result); ?> <style type="text/css"> <!-- .style2 {font-weight: bold} .style3 { font-family: Arial, Helvetica, sans-serif; color: #000000; } .style10 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; } #Layer1 { position:absolute; left:803px; top:36px; width:65px; height:28px; z-index:1; } #Layer2 { position:absolute; left:707px; top:19px; width:143px; height:39px; z-index:1; } --> </style> <title>User overview</title> </html> <div id="Layer2"> <form action="<?= $_SERVER['PHP_SELF'] ?>" method="post"> <input type="hidden" name="foo" value="<?= $foo ?>" /> <input type="submit" name="submit" value="Refresh" /> </form></div> <table width="779" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#996600"> <tr> <td width="777"> <div align="left"> <table width="779" border="1" cellspacing="0" cellpadding="3"> <tr> <td colspan="6" align="center"><div align="center" class="style1 style3"><strong>SchoolPorta.com Users / Total: <?php echo $num_rows ?></strong></div></td> </tr> <tr> <td width="342" align="center"><span class="style2">school</span></td> <td width="62" align="center"><span class="style2">Name</span></td> <td width="104" align="center"><span class="style2">Lastname</span></td> <td width="130" align="center"><span class="style2">Email</span></td> <td width="64" align="center"><span class="style2">Update</span></td> </tr> <?php while($rows=mysql_fetch_array($result)){ ?> <tr> <td><span class="style10"><? echo $rows['school_name']; ?></span></td> <td><span class="style10"><? echo $rows['user_first_name']; ?></span></td> <td><span class="style10"><? echo $rows['user_surname']; ?></span></td> <td><span class="style10"><a href="mailto:<?php echo $rows['user_login']; ?>"><?php echo $rows['user_login']; ?></a></span></td> <td align="center"><a href="update.php?id=<? echo $rows['user_id']; ?>" class="style10">update</a></td> </tr> <?php } ?> </table> </div></td> </tr> </table> <div align="left"> <p> </p> <p> </p> <p> </p> <p> <?php mysql_close(); ?> </p> </div> <?php $host="xxx"; // Host name $username="xxx"; // Mysql username $password="xxx"; // Mysql password $db_name="xxx"; // Database name //$tbl_name="sp_users"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // get value of id that sent from address bar $id=$_GET['user_id']; ?> <?php $sql="SELECT * from sp_users,sp_schools where sp_users.user_id=sp_schools.school_id"; $result=mysql_query($sql) or die("Problem with the query: $sql<br>" . mysql_query()); ?> <table width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <form name="form1" method="post" action="update_ac.php"> <td> <table width="100%" border="0" cellspacing="1" cellpadding="0"> <tr> <td> </td> <td colspan="3"><div align="center" class="style1">Update data in mysql </div></td> </tr> <tr> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> </tr> <tr> <td align="center"> </td> <td align="center"><span class="style7">Name</span></td> <td align="center"><span class="style7">Lastname</span></td> <td align="center"><span class="style7">Email</span></td> </tr> <tr> <td> </td> <td align="center"><input name="name" type="text" id="name" value="<? echo $rows['user_first_name']; ?>"></td> <td align="center"><input name="lastname" type="text" id="lastname" value="<? echo $rows['user_surname']; ?>" size="15"></td> <td><input name="email" type="text" id="email" value="<? echo $rows['user_login']; ?>" size="15"></td> </tr> <tr> <td> </td> <td><input name="id" type="hidden" id="id" value="<? echo $rows['user_id']; ?>"></td> <td align="center"><input type="submit" name="Submit" value="Submit"></td> <td> </td> </tr> </table> </td> </form> </tr> </table> <? // close connection mysql_close(); ?> </body> </html> <?php $host="xxx"; // Host name $username="xxx"; // Mysql username $password="xxx"; // Mysql password $db_name="xxx"; // Database name $tbl_name="sp_users"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // update data in mysql database $sql="UPDATE $tbl_name SET name='$user_name', lastname='$user_lastname', email='$email' WHERE id='$user_id'"; $result=mysql_query($sql); // if successfully updated. if($result){ echo "Successful"; echo "<BR>"; echo "<a href='pback.php'>View result</a>"; } else { echo "ERROR"; } ?>
  16. Hi How can I decrypt a mysql password. In this case: e9e0fd927aa0c3c5c3ac59b99fdbb110 I have a database for user where the passwords are all decrypted but in order for me to help them with their accounts I need to go into it.. Thanks!
  17. ok thanks... How do I do that?
  18. Hi guys I have a problem. I limit the displayed rows by 10 (which works) and then a link saying "next" or "previous" The link itself works, but the site always just displays teh first 10 data entries. What do I do wrong? Thank you! <?php $host="****"; // Host name $username="****"; // Mysql username $password="****"; // Mysql password $db_name="****"; // Database name $tbl_name="sp_users"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); //$sql="SELECT * FROM $tbl_name ORDER BY user_id"; $sql="SELECT * from sp_users,sp_schools where sp_users.user_id=sp_schools.school_id ORDER BY school_name LIMIT 0, 10"; $result=mysql_query($sql); $num_rows=mysql_num_rows($result); ?> <?PHP //check if the starting row variable was passed in the URL or not if (!isset($_GET['startrow']) or !is_numeric($_GET['startrow'])) { //we give the value of the starting row to 0 because nothing was found in URL $startrow = 0; //otherwise we take the value from the URL } else { $startrow = (int)$_GET['startrow']; } ?> <?PHP //this part goes after the checking of the $_GET var $fetch = mysql_query("SELECT * FROM sp_users,sp_schools where sp_users.user_id=sp_schools.school_id LIMIT $startrow, 10")or die(mysql_error()); ?> <style type="text/css"> <!-- .style2 {font-weight: bold} .style3 { font-family: Arial, Helvetica, sans-serif; color: #000000; } .style10 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; } #Layer1 { position:absolute; left:803px; top:36px; width:65px; height:28px; z-index:1; } #Layer2 { position:absolute; left:707px; top:19px; width:143px; height:39px; z-index:1; } #Layer3 { position:absolute; left:247px; top:463px; width:175px; height:53px; z-index:2; } --> </style> <title>User overview</title> </html> <div id="Layer2"> <form action="<?= $_SERVER['PHP_SELF'] ?>" method="post"> <input type="hidden" name="foo" value="<?= $foo ?>" /> <input type="submit" name="submit" value="Refresh" /> </form></div> <div id="Layer3"><?PHP //now this is the link.. echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow='.($startrow+10).'">Next</a>'; ?> <?PHP $prev = $startrow - 10; //only print a "Previous" link if a "Next" was clicked if ($prev >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow='.$prev.'">Previous</a>'; ?></div> <table width="779" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#996600"> <tr> <td width="777"> <div align="left"> <table width="779" border="1" cellspacing="0" cellpadding="3"> <tr> <td colspan="6" align="center"><div align="center" class="style1 style3"><strong>SchoolPorta.com Users / Total: <?php echo $num_rows ?></strong></div></td> </tr> <tr> <td width="342" align="center"><span class="style2">school</span></td> <td width="62" align="center"><span class="style2">Name</span></td> <td width="104" align="center"><span class="style2">Lastname</span></td> <td width="130" align="center"><span class="style2">Email</span></td> <td width="64" align="center"><span class="style2">Update</span></td> </tr> <?php while($rows=mysql_fetch_array($result)){ ?> <tr> <td><span class="style10"><? echo $rows['school_name']; ?></span></td> <td><span class="style10"><? echo $rows['user_first_name']; ?></span></td> <td><span class="style10"><? echo $rows['user_surname']; ?></span></td> <td><span class="style10"><a href="mailto:<?php echo $rows['user_login']; ?>"><?php echo $rows['user_login']; ?></a></span></td> <td align="center"><a href="update.php?id=<? echo $rows['user_id']; ?>" class="style10">update</a></td> </tr> <?php } ?> </table> </div></td> </tr> </table> <div align="left"> <p> </p> <p> </p> <p> </p> <p> <?php mysql_close(); ?> </p> </div>
  19. Hi Maq, thanks, but I think I did not explain myself correctly, because now it shows in every column the total amount of rows. I want that it counts 1,2,3,4,etc...
  20. Hi guys, I want to count the number of rows in a table and want to display them. However that field stays empty. Everythign else works. What do I do wrong? <?php //$sql="SELECT * FROM $tbl_name ORDER BY user_id"; $sql="SELECT * from sp_users,sp_schools where sp_users.user_id=sp_schools.school_id"; $result=mysql_query($sql); $num_rows=mysql_num_rows($result); ?> <style type="text/css"> <!-- .style2 {font-weight: bold} .style3 { font-family: Arial, Helvetica, sans-serif; color: #000000; } .style10 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; } --> </style> <title>User overview</title><table width="779" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#996600"> <tr> <td width="777"> <div align="left"> <table width="779" border="1" cellspacing="0" cellpadding="3"> <tr> <td colspan="6" align="center"><div align="center" class="style1 style3"><strong>SchoolPorta.com Users </strong></div></td> </tr> <tr> <td width="25" align="center"><span class="style2">No.</span></td> <td width="62" align="center"><span class="style2">Name</span></td> <td width="104" align="center"><span class="style2">Lastname</span></td> <td width="130" align="center"><span class="style2">Email</span></td> <td width="342" align="center"><span class="style2">school</span></td> <td width="64" align="center"><span class="style2">Update</span></td> </tr> <?php while($rows=mysql_fetch_array($result)){ ?> <tr> <td><span class="style10"><? echo $rows['num_rows']; ?></span></td> <td><span class="style10"><? echo $rows['user_first_name']; ?></span></td> <td><span class="style10"><? echo $rows['user_surname']; ?></span></td> <td><span class="style10"><a href="mailto:<?php echo $rows['user_login']; ?>"><?php echo $rows['user_login']; ?></a></span></td> <td><span class="style10"><? echo $rows['school_name']; ?></span></td> <td align="center"><a href="update.php?id=<? echo $rows['user_id']; ?>" class="style10">update</a></td> </tr> <?php } ?>
  21. Hi guys I need your help, I am trying already for days to sort it out but does not work. My file "pback.php" displays the mysql table "sp_users". I want to add the columns "school_name" and "school_address" from another table "sp_schools" (same database) at the right end of the displayed table in "pback.php" (after the column update) I tried with leftjoin but it does not work. Please help me. I am getting really frustrated. Thank you... <?php $host="xxx"; // Host name $username="xxx"; // Mysql username $password="xxx"; // Mysql password $db_name="xxxx"; // Database name $tbl_name="sp_users"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name ORDER BY user_id"; $result=mysql_query($sql); ?> <style type="text/css"> <!-- .style2 {font-weight: bold} .style3 { font-family: Arial, Helvetica, sans-serif; color: #000000; } .style10 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; } --> </style> <title>User overview</title><table width="486" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#996600"> <tr> <td width="427"> <div align="left"> <table width="486" border="1" cellspacing="0" cellpadding="3"> <tr> <td colspan="4"><div align="center" class="style1 style3"><strong>SchoolPorta.com Users </strong></div></td> </tr> <tr> <td width="26" align="center"><span class="style2">id</span></td> <td width="70" align="center"><span class="style2">Name</span></td> <td width="114" align="center"><span class="style2">Lastname</span></td> <td width="146" align="center"><span class="style2">Email</span></td> <td width="88" align="center"><span class="style2">Update</span></td> </tr> <?php while($rows=mysql_fetch_array($result)){ ?> <tr> <td><span class="style10"><? echo $rows['user_id']; ?></span></td> <td><span class="style10"><? echo $rows['user_first_name']; ?></span></td> <td><span class="style10"><? echo $rows['user_surname']; ?></span></td> <td><span class="style10"><a href="mailto:<?php echo $rows['user_login']; ?>"><?php echo $rows['user_login']; ?></a></span></td> <td align="center"><a href="update.php?id=<? echo $rows['user_id']; ?>" class="style10">update</a></td> </tr> <?php } ?> </table> </div></td> </tr> </table> <div align="left"> <p> </p> <p> </p> <p> </p> <p> <?php mysql_close(); ?> </p> </div>
  22. Hi Mjdamato, thanks!!! reg. hunting down... you are right. Thats why this file is in a non accessible directory. Just for me to see who registered... Thanks again.
×
×
  • 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.