Jump to content

Search the Community

Showing results for tags 'html'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. Hello everyone, i'm Osiris and i'm stuck with this PHP/HTML code, i'm fairly new at this so this might be a dumb question. i have a database, but i want to output all data into a table from the database using HTML codes. i had it so far that i could outpust the info in just plain text but it doesn't output in the HTML table. Can anyone see what i did wrong? This is my PHP code its in the body section <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'password'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('Could not connect: ' . mysql_error()); } $sql = 'SELECT `Name`, `Color`, `Type`, `Subtype`, `Power`, `Toughness`, `Manacost`, `Rarity`, `Expansion`, `Foil`, `Stock` FROM `mtgtabel`'; mysql_select_db('mtgstock'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not get data: ' . mysql_error()); } echo '<table class=mytable>'; echo "<tr><th >Name</th><th >Color</th><th >Type</th><th >Sub Type</th><th >Power</th><th >Toughness</th><th >Converted mana cost</th><th >Rarity</th><th >Expansion</th><th >Foil</th><th >Stock</th></tr>"; while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) { echo "<tr><td>"; echo $row['Name'] echo "</td><td>"; echo $row['Color']; echo "</td><td>"; echo $row['Type']; echo "</td><td>"; echo $row['Subtype']; echo "</td><td>"; echo $row['Power']; echo "</td><td>"; echo $row['Toughness']; echo "</td><td>"; echo $row['Manacost']; echo "</td><td>"; echo $row['Rarity']; echo "</td><td>"; echo $row['Expansion']; echo "</td><td>"; echo $row['Foil']; echo "</td><td>"; echo $row['Stock']; echo "</td></tr>"; } echo "</table>"; mysql_close($conn); ?> Thanks in advance!
  2. Hello All, I have been going crazy trying to figure this out, I hope someone can help me out I have header and footer.php files that on all my pages I get them to load with include, but for some strange reason, this certain page it will not load I did some research and apparently theres problems with div and php, does anyone know how to make this work? Thank you in advance, Elaine test.txt
  3. When I click on the letter of the alphabet on my form page, it will bring up the results of my query. I got this part working. The next part is to be able to click on any of the populated results and have it autofill my form with organization, first name, last name, email address and phone number. I know that I need to use Ajax and jQuery to accomplish this. Here is my html <!-- Letter Search --> <div class="searchBox span12"> <h3>Choose the First Letter of the Person's Last Name</h3> <ul> <li class="alphabets" id="A"><a href="?by=A">A</a></li> <li class="alphabets" id="B"><a href="?by=B">B</a></li> <li class="alphabets" id="C"><a href="?by=C">C</a></li> <li class="alphabets" id="D"><a href="?by=D">D</a></li> <li class="alphabets" id="E"><a href="?by=E">E</a></li> <li class="alphabets" id="F"><a href="?by=F">F</a></li> <li class="alphabets" id="G"><a href="?by=G">G</a></li> <li class="alphabets" id="H"><a href="?by=H">H</a></li> <li class="alphabets" id="I"><a href="?by=I">I</a></li> <li class="alphabets" id="J"><a href="?by=J">J</a></li> <li class="alphabets" id="K"><a href="?by=K">K</a></li> <li class="alphabets" id="L"><a href="?by=L">L</a></li> <li class="alphabets" id="M"><a href="?by=M">M</a></li> <li class="alphabets" id="N"><a href="?by=N">N</a></li> <li class="alphabets" id="O"><a href="?by=O">O</a></li> <li class="alphabets" id="P"><a href="?by=P">P</a></li> <li class="alphabets" id="Q"><a href="?by=Q">Q</a></li> <li class="alphabets" id="R"><a href="?by=R">R</a></li> <li class="alphabets" id="S"><a href="?by=S">S</a></li> <li class="alphabets" id="T"><a href="?by=T">T</a></li> <li class="alphabets" id="U"><a href="?by=U">U</a></li> <li class="alphabets" id="V"><a href="?by=V">V</a></li> <li class="alphabets" id="W"><a href="?by=W">W</a></li> <li class="alphabets" id="X"><a href="?by=X">X</a></li> <li class="alphabets" id="Y"><a href="?by=Y">Y</a></li> <li class="alphabets" id="Z"><a href="?by=Z">Z</a></li> </ul> <? include('search.php'); ?> </div> <hr style="color:#ccc; margin-bottom:20px;" /> <!-- Main Form --> <div id="mainForm"> <form method="post" id="icsForm" class="searchBox span12"> <div id="col1" class"span6"> <h3>Contact Information</h3> <label>Church / Organization:</label><input type="text" name="organization" id="organization" class="span6 upright" /><br /> <label>First Name:</label><input type="text" name="firstName" id="firstName" class="span6 upright" /> <label>Last Name:</label><input type="text" name="lastName" id="lastName" class="span6 left upright" /> <label>Email Address:</label><input type="text" name="email" id="email" class="span6 left upright" /> <label>Phone Number:</label><input type="text" name="phone" id="phone" class="span6 left upright" /> </div> </div> Here is my php if(preg_match("/^[A-Z | a-z]+/", $_POST['name'])){ $name=$_POST['name']; } if(isset($_GET['by'])){ $letter=$_GET['by']; //query to sort by last name $sql="SELECT contact_id, first_name, last_name, church_org, email_address, phone_number FROM ics_data WHERE last_name LIKE '$letter%' ORDER BY last_name ASC"; //run the query against the mysql query function $result=mysql_query($sql); //count results $numrows=mysql_num_rows($result); echo "<p>" .$numrows . " results found for " . $letter . "</p>"; //Create while loop and loop through result set while($row=mysql_fetch_array($result)){ $first_name=$row['first_name']; $last_name=$row['last_name']; $church_org=$row['church_org']; $email_address=$row['email_address']; $phone_number=$row['phone_number']; $contact_id=$row['contact_id']; //display the result of the array echo "<div id=\"search-results\">"; echo "<ul class=\"letter-results\">\n"; echo "<li class=\"result-row\">" . "<a href=\"#\" class=\"testclass\">" .$first_name . " " .$last_name . "". ", " ."" .$church_org ."</a></li>\n"; echo "</ul>"; echo "</div>"; } } Here is my Javascript file (Ajax) $(document).ready( function() { function formfill() { var organization = $('#organization').val(); var firstname = $('#firstname').val(); var lastname = $('#lastname').val(); var email = $('#email').val(); var phone = $('#phone').val(); $.ajax ({ method: "GET", url: "search.php", dataType: 'json', data: { organization:organization, firstname:firstname, lastname:lastname, email:email, phone:phone }, type: "POST", success: function(data) { $organization $firstname $lastname $email $phone }, failure: function() { alert('fail!'); } }); } I know that I do not have a reference yet to JSON in my php file and that it is needed. I'm not solid on the Ajax part. That is the part that is tripping me up. I know that I need to make the form autofill when clicking on a specific result returned from my query... but i'm not sure how to do that. Thank you in advance for any help or advice you can give!! I am relatively new to programming. Hopefully I posted this in the right forum as a lot of these technologies overlap.
  4. Hi experts,I have the following problem.I have a file login.php which is used to allow users to log in.When the form is submitted it is redirected to checkuserlogin.php.If the credentials are right he is redirected to main.php.But in main.php if the user clicks back browser button,he is redirected to login.php and in login.php if he presses forward button,he is redirected to main.php.Can any one tell he how to make sure the application is not redirected to main.php when user presses forward button and how to make sure the application is not redirected to login.php when user presses back button.
  5. Sorry for the beginner question, here I'm trying to retrieve data from the database and display it in the table format. But only table headers are printed, and not the actual values. The count variable is echoing 2 saying that data is present and correctly retrieved. Can anyone help? <?php include 'connect.php'; error_reporting(E_ALL ^ E_DEPRECATED); error_reporting(E_ERROR | E_PARSE); $sql="SELECT * FROM `resources` as r INNER JOIN `project_resources` as pr ON r.res_id =pr.res_id WHERE project_id='$_POST[project_id]'"; $result=mysql_query($sql); $count=mysql_num_rows($result); if($result === FALSE) { die(mysql_error()); } echo "$count"; echo '<table> <tr> <th>Resource ID</th> <th>Resource Name</th> <th>Email</th> <th>Phone Number</th> <th>Reporting Manager</th> <th>Role</th> <th>Designation</th> </tr>'; while ($row = mysql_fetch_array($result)) { echo ' <tr> <td>'.$row['res_id'].'</td> <td>'.$row['res_name'].'</td> <td>'.$row['email'].'</td> <td>'.$row['phone_number'].'</td> <td>'.$row['reporting_manager'].'</td> <td>'.$row['role'].'</td> <td>'.$row['designation'].'</td> </tr>'; } echo ' </table>'; ?>
  6. <html> <head> <title>Citigate Travel Plus</title> <link rel="stylesheet" type="css" href="homepage.css"/> <link rel="stylesheet" type="css" href="modalcss.css"/> <link type="text/css" href="jquery-ui-1.7.3.custom.css" rel="stylesheet" /> <script src = "jquery-1.6.2.min.js" type = "text/javascript"></script> <script src = "jquery-ui-1.7.3.custom.min.js" type = "text/javascript"></script> <script type='text/javascript' src='slideshow.js'></script> <script type='text/javascript' src='jquery.js'></script> <script type='text/javascript' src='modal.js'></script> </head> <body> <?php include 'layoutbasic.php'; require_once("connect.php"); session_start(); $page="homepage.php"; $status = $_SESSION['status']; $position=""; $featuredspot = array(); $slideshow = mysql_query("select * from tblhomepageslideshow ORDER BY ID DESC "); while($r=mysql_fetch_array($slideshow)) { array_push($featuredspot, $r[1]); } ?> <img src="promo.png" id="promo"/> <input type="image" src="inquiry.png" name="inquiry" id="inquiry" onclick="window.location.href = 'searchinquiry.php'"/> <input type="image" src="operator.png" name="operator" id="operator"/> <div id="photoShow"> <div class="current"> <img src="<?php echo $featuredspot[0]?>" alt="Photo Gallery" width="700" height="280" class="gallery"/> </div> <div> <img src="<?php echo $featuredspot[1]?>" alt="Photo Gallery" width="700" height="280" class="gallery"/> </div> <div> <img src="<?php echo $featuredspot[2]?>" alt="Photo Gallery" width="700" height="280" class="gallery"/> </div> <div> <img src="<?php echo $featuredspot[3]?>" alt="Photo Gallery" width="700" height="280" class="gallery"/> </div> <div> <img src="<?php echo $featuredspot[4]?>" alt="Photo Gallery" width="700" height="280" class="gallery"/> </div> </div> <?php if($status==1) { $email = $_SESSION['email']; $check = mysql_query("select * from tblmember where emailadd = '$email' "); $row1 = mysql_fetch_assoc($check); $fname = $row1['firstname']; $position = $row1['status']; echo "<div style = 'position:absolute; top:60; left:700; width:460; height:50; text-align:right; font-family:arial;'>"; echo "<h2>Hello, $fname</h2>"; echo "</div>"; } else{ echo "<div style = 'position:absolute; top:55; left:700; width:460; height:50; text-align:right; font-family:arial;'>"; echo "<h1>Citigate Travel Plus</h1>"; echo "</div>"; } include 'layoutmenus.php'; ?> <div id="chatbox"> <script id="sid0020000064511697063">(function() {function async_load(){s.id="cid0020000064511697063";s.src=(window.location.href.indexOf('file:///') > -1 ? 'http:' : '') + '//st.chatango.com/js/gz/emb.js'; s.style.cssText="width:250px;height:500px;"; s.async=true;s.text='{"handle":"citigatetravelplus","arch":"js","styles":{"a":"0f507e","b":100,"c":"FFFFFF","d":"FFFFFF","k":"0f507e","l":"0f507e","m":"0f507e","n":"FFFFFF","q":"0f507e","r":100,"allowpm":0,"cnrs":"0.35"}}'; var ss = document.getElementsByTagName('script'); for (var i=0, l=ss.length; i < l; i++){ if (ss.id=='sid0020000064511697063'){ss.id +='_';ss.parentNode.insertBefore(s, ss);break;}}}var s=document.createElement('script'); if (s.async==undefined){if (window.addEventListener) {addEventListener('load',async_load,false);} else if (window.attachEvent) {attachEvent('onload',async_load);}}else {async_load();}})(); </script> </div> </body> </html> <?php $per_page = 4; $start = $_GET['start']; $record_count = mysql_num_rows(mysql_query("SELECT * FROM tblpromopackages")); $max_pages = $record_count / $per_page; $promo = mysql_query("select * from tblpromopackages LIMIT $start, $per_page"); $x=500; $y=410; $picture=0; while($row=mysql_fetch_array($promo)) { $id = $row[0]; $pname = $row[1]; $pprice = $row[2]; $image = $row[3]; echo "<div style='position:absolute; top:".$x."px; left:". $y . "px; font: 15px arial; text-align:center; '>"; echo"<img src='$image'; width=200px; height=120px;><br/>"; echo "$pname"; echo "<form action='preview.php' method='POST'>"; echo "<br/><input type='image' src='btnDetails.png'/>"; echo "<input type='hidden' name='id' id='id' value='$id'/>"; echo "<input type='hidden' name='table' id='table' value='tblpromopackages'/>"; echo "<input type='hidden' name='exit' id='exit' value='homepage.php'/>"; echo "</form>"; echo"</div>"; if($position=="admin") { $a=$x-8; $b=$y-8; echo "<div style='position:absolute; top:".$a."px; left:". $b . "px; font: 15px arial; text-align:center; '>"; echo "<a href='editpackage.php?edit=" . $id . "&table=tblpromopackages&exit=homepage.php'>[Edit]</a>"; echo"</div>"; $a=$x-8; $b=$y+180; echo "<div style='position:absolute; top:".$a."px; left:". $b . "px; font: 15px arial; text-align:center; '>"; echo "<a href='delete.php?id=" . $id . "&exit=homepage.php&table=tblpromopackages' onClick='confirm('Are you sure?')'><img src='delete.png'/ style='width:30; heigth:30;'></a>"; echo"</div>"; } if($picture<1) { $y = $y+250; $picture=$picture+1; } else { $picture=0; $y=410; $x=$x+210; } } if($position=="admin"){ echo "<div style='position:absolute; top:462px; left:850px; font: 15px arial; text-align:center; '>"; echo "<a href='addpromo.php' style='color:white'>[Add]</a>"; echo"</div>"; echo "<div style='position:absolute; top:165px; left:850px; font: 15px arial; text-align:center; '>"; echo "<a href='addfeaturedspots.php' style='color:white'>[Add]</a>"; echo"</div>"; } if($max_pages>1){ echo "<div style='position:absolute; top:900px; left:350px; height:20;'>"; echo "<ul class='paginate'>"; $prev = $start - $per_page; $next = $start + $per_page; if ($start>0){ echo " <a href='homepage.php?start=$prev'>prev</a> "; ?> <script type="text/javascript"> window.scrollTo(0,450); </script> <?php } $i=1; for ($x=0;$x<$record_count;$x=$x+$per_page) { if ($start!=$x) echo "<a href='homepage.php?start=$x'>$i</a> "; else echo "<a href='homepage.php?start=$x'><b>$i</b></a>"; $i++; } if ($start<$record_count-$per_page) echo "<a href='homepage.php?start=$next'>next</a>"; echo "</ul>"; echo"</div>"; } ?> <a href="https://www.facebook.com/zenoedge?fref=ts" target="_blank" class="twitter-share-button" data-lang="en" id="ads"> <img src="ads.png" height="500"> </a> homepage.css
  7. As a complete newbie to php and webdesigning i have a following problem.I would like to retrieve the data from database and display it in a drop down menu.Then i should allow the user to select the values from drop down list along with other details,in other words i have to embed the drop down output as the form input for the user and store the form data in another table.I am running a xampp server and i am using php 5.4 version.Please help.My code is as follows.In this case project_name is displayed as the drop down output.but how do i use the same drop down output as a input in the form. <html> <head></head> <body> <?php error_reporting(E_ALL ^ E_DEPRECATED); include 'connect.php' ; $tbl_name="projects"; $sql="SELECT project_name FROM $tbl_name "; $result=mysql_query($sql); if($result === FALSE) { die(mysql_error()); } ?> <form name="resources" action="hourssubmit.php" method="post" > <?php echo "<select name='project_name'>"; while ($row = mysql_fetch_array($result)) { echo "<option value='" . $row['project_name'] ."'>" . $row['project_name'] ."</option>"; } echo "</select>"; ?> </form> </body> </html>
  8. Hello, I have created a webpage that essentially generates an sql query and then puts the results into a table that is displayed. On one of the columns in this displayed table, I want to allow the user to click on each of the values which will in turn execute a php function. I have the hyperlink working but this is to a separate page. What I actually need to do is firstly - just ran a php function that will create a new table beneath the currently displayed one. Secondly, once this is achieved, I need to pass some value to the function so that the generated table is dependent on the value that was clicked. I've tried a few things and researched but I am struggling. I am a beginner. Any help would be greatly appreciated. Here is an extract of the code used for inputting data into the original table - showValuesSR is the function name <?php while (!$rsMetrics->EOF) { ?> <tr> <?php for ($x=0; $x<$numberOfFields; $x++) { if ($fieldNames[$x] == "Values_SR"){ ?> <td><a href= ?showValuesSR><?php echo $rsMetrics->fields[$fieldNames[$x]]->Value?></a></td> <?php } else{ ?> <td><?php echo $rsMetrics->fields[$fieldNames[$x]]->Value?></td> <?php } } ?> </tr> <?php $rsMetrics->MoveNext(); } ?> </table> <?php function showValuesSR(){ ?> <table border="0" cellpadding="5" width="100%"> <tr><td background="../images/table_toolbar_bkg.gif" align="center"><font color="Blue" face="verdana" size="2"><strong>function working</strong></td></tr> </table> <?php } ?>
  9. Hi I have a frame that load a php element, but I want to load at same time a javascript element. The code load correctly the php element in the frame but I can't figure out where to insert the javascript. The javascript is a slide in ads. Here is the code of the php element : <frame src="<?php echo getRandomInterstitualAdUrl(); ?>" noresize/> And here is the javascript code : <script type="text/javascript" src="http://exemple.com/adServe/banners?tid=L_16601_7&type=slider&position=bottom&animate=on&side=left&size=300x250" ></script>
  10. Hello i am trying to make the admin login in a webpage and after I completed the page i uploaded it and now the page is not loading Here is the script <?php error_reporting(E_ALL); ini_set('display_errors', '1'); exit(); ?> <?php session_start(); if (!isset($_SESSION["manager"])){ header("location:admin_login.php"); exit(); } exit(); ?> <?php if(isset($_POST["username"])&&isset($_POST["password"])){ $manager=preg_replace('#[^A-Za-z0-9]#i','',$_POST["username"]); $password=preg_replace('#[^A-Za-z0-9]#i','',$_POST["password"]); include"../storescripts/connect_to_mysql.php"; $sql=mysql_querey("SELECT id FROM admin WHERE username='$manager' AND password='$password' LIMIT 1"); if($existCount == 1){ while($row = mysql_fetch_array($sql)){ $id = $rpw["id"]; } $_SESSION["id"] = $id; $_SESSION["manager"] = $manager; $_SESSION["password"] = $password; header("location:index.php"); exit(); } else { echo 'That Information is incorrect, try again <a href="index.php">Click Here</a>'; exit(); } } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Admin Login</title> <link rel="stylesheet" href="k../style/style.css" type="text/css" media=="screen" /> <script type="text/javascript" src="//use.typekit.net/jxp6vds.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> </head> <body> <div align="centre" id="mainWrapper"> <?php include_once("../template_header.php") ?> <div id="pageConntent"> <h2>Please Log In To Manage The store</h2> <form id="form1" name="form1" meathod="post" action="admin_login.php"> Username:<br/> <input name="username" type="text" id="username" size="40"/> <br/><br/> Password<br/> <input name="password" type="password" id="password" size="40"/> <br/> <br/> <br/> <input type="submit" name="button" id="button" value="Log In" /> </form> </div> <?php include_once("../footer.php"); ?> </div> </body> </html> Thank you in advance
  11. Hi Everyone.. I am not sure if I should post this question here. I would like to fix this problem using PHP rather than HTML. I am new to PHP. This code is part of an old PHP gallery file. I am trying to validate my site but the site's links have some characters that makes the link throw errors in W3C Validator. So I tried to replace the characters with HTML characters for example ? are now replaced by ? so my original link before using valid HTML characters looked like www.awebsite.com/viewgallery.php?cname=Colorado-Fall&pcaption=Lost-In-The-art And now it looks like this ... www.awebsite.com/viewgallery.php?cname=Colorado-Fall&pcaption=Lost-In-The-art But now W3C Validator shows an error like this The ? for replacing ? seems to be the problem.The & is highlighted in red. What am I doing wrong? How can I validate this link? I tried to use single or double quotes around HTML characters but that breaks my links and they won't work after that. Any tips will be appreciated...
  12. I have noticed 2 script errors on my site within the .php files but can't see why they're occurring. The first appears at the bottom of my wordpress admin page: Notice: Array to string conversion in /home/orkwine/public_html/test/wp-includes/class.wp-scripts.php on line 123 This is the area in that file: `$srce = apply_filters( 'script_loader_src', $src, $handle ); if ( $this->in_default_dir($srce) ) { $this->print_code .= $this->print_extra_script( $handle, false ); $this->concat .= "$handle,"; $this->concat_version .= "$handle$ver"; return true; } else { $this->ext_handles .= "$handle,"; $this->ext_version .= "$handle$ver"; } }` Line 123 is: $this->ext_version .= "$handle$ver"; The other error i am getting is: Notice: Undefined index: prettyPhoto in /home/orkwine/public_html/test/wp-includes/class.wp-scripts.php on line 185 Notice: Trying to get property of non-object in /home/orkwine/public_html/test/wp-includes/class.wp-scripts.php on line 185 These are lines 183-194 in that file:` function set_group( $handle, $recursion, $group = false ) { if ( $this->registered[$handle]->args === 1 ) $grp = 1; else $grp = (int) $this->get_data( $handle, 'group' ); if ( false !== $group && $grp > $group ) $grp = $group; return parent::set_group( $handle, $recursion, $grp ); }` Line 185 is: if ( $this->registered[$handle]->args === 1 ) Can anyone help solve these errors? The full file can be seen here: http://pastebin.com/spBAhuHf Here is a link to one of the pages in the website which shows the second error. http://test.orkneywine.co.uk/online-store/elderberry-borealis-35cl/ Can anyone help with this?
  13. I am using html5 and all the pages have h2 headings as titles. They all show up in google search results fine. The only thing that doesn't show up fine are some of the descriptions under each heading. Some meta descriptions show up fine under the correct heading title, while rest shows ALL the heading tags AS description under each search result. For eg. Cars www.mywebsite.com/category?id=5&name=cars 4 days ago - Mywebsite · Login · Signup · About · Lola's Dress · Create a product · Find Products · News Feed. Recent Products ... The above description includes the h2 heading tags of all the pages when it should only show the description of the page that I setup in the meta tags. Anyone know why this is happening?
  14. Hey, I have an issue where the below script doesnt appear to be working. It doesnt actually display anything on the page, it seems as though after the first PHP tag is just ignores the rest of the script. when looking at the page source all it shows is: <HTML> <HEAD> <TITLE>Logs</TITLE> </HEAD> <BODY> The actual code is below: <HTML> <HEAD> <TITLE>Logs</TITLE> </HEAD> <BODY> <?PHP $mysqlserver="localhost"; $mysqlusername="root"; $mysqlpassword="test"; $dbname = 'test'; $con=mysqli_connect($mysqlserver, $mysqlusername, $mysqlpassword, $dbname); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con, "SELECT * FROM forwardtable"); echo "<table border='1'> <tr> <th>Acc Num</th> <th>Send Date</th> <th>Send Time</th> </tr>"; while($rowContent = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>" . $rowContent['Acc'] . "</td>"; echo "<td>" . $rowContent['Date'] . "</td>"; echo "<td>" . $rowContent['Time'] . "</td>"; echo "</tr>"; } echo "</table>" ?> </BODY> </HTML> If I remove the PHP from within the code the source code goes as it should and shows the </BODY> and </HTML> tags. Any ideas anyone? Thanks, Matt
  15. Is w3c a truce source to follow for any errors found on a website? For eg. I have my links setup like this. < a href="record.php?id=4&user=smith"></a> W3C is tell me to not use "&" symbol and that instead escape it as & So what do I just replace & with & in all my links?
  16. For eg. I would prefer to have a link like this in the head section. <head> <script src="js/code.js"></script> </head> as oppose to like this. <head> <script> var _debug = false; var _placeholderSupport = function() { var t = document.createElement("input"); t.type = "text"; return (typeof t.placeholder !== "undefined"); }(); window.onload = function() { var arrInputs = document.getElementsByTagName("input"); var arrTextareas = document.getElementsByTagName("textarea"); var combinedArray = []; for (var i = 0; i < arrInputs.length; i++) combinedArray.push(arrInputs[i]); for (var i = 0; i < arrTextareas.length; i++) combinedArray.push(arrTextareas[i]); for (var i = 0; i < combinedArray.length; i++) { var curInput = combinedArray[i]; if (!curInput.type || curInput.type == "" || curInput.type == "text" || curInput.type == "textarea") HandlePlaceholder(curInput); else if (curInput.type == "password") ReplaceWithText(curInput); } if (!_placeholderSupport) { for (var i = 0; i < document.forms.length; i++) { var oForm = document.forms[i]; if (oForm.attachEvent) { oForm.attachEvent("onsubmit", function() { PlaceholderFormSubmit(oForm); }); } else if (oForm.addEventListener) oForm.addEventListener("submit", function() { PlaceholderFormSubmit(oForm); }, false); } } }; function PlaceholderFormSubmit(oForm) { for (var i = 0; i < oForm.elements.length; i++) { var curElement = oForm.elements[i]; HandlePlaceholderItemSubmit(curElement); } } function HandlePlaceholderItemSubmit(element) { if (element.name) { var curPlaceholder = element.getAttribute("placeholder"); if (curPlaceholder && curPlaceholder.length > 0 && element.value === curPlaceholder) { element.value = ""; window.setTimeout(function() { element.value = curPlaceholder; }, 100); } } } function ReplaceWithText(oPasswordTextbox) { if (_placeholderSupport) return; var oTextbox = document.createElement("input"); oTextbox.type = "text"; oTextbox.id = oPasswordTextbox.id; oTextbox.name = oPasswordTextbox.name; //oTextbox.style = oPasswordTextbox.style; oTextbox.className = oPasswordTextbox.className; for (var i = 0; i < oPasswordTextbox.attributes.length; i++) { var curName = oPasswordTextbox.attributes.item(i).nodeName; var curValue = oPasswordTextbox.attributes.item(i).nodeValue; if (curName !== "type" && curName !== "name") { oTextbox.setAttribute(curName, curValue); } } oTextbox.originalTextbox = oPasswordTextbox; oPasswordTextbox.parentNode.replaceChild(oTextbox, oPasswordTextbox); HandlePlaceholder(oTextbox); if (!_placeholderSupport) { oPasswordTextbox.onblur = function() { if (this.dummyTextbox && this.value.length === 0) { this.parentNode.replaceChild(this.dummyTextbox, this); } }; } } function HandlePlaceholder(oTextbox) { if (!_placeholderSupport) { var curPlaceholder = oTextbox.getAttribute("placeholder"); if (curPlaceholder && curPlaceholder.length > 0) { Debug("Placeholder found for input box '" + oTextbox.name + "': " + curPlaceholder); oTextbox.value = curPlaceholder; oTextbox.setAttribute("old_color", oTextbox.style.color); oTextbox.style.color = "#c0c0c0"; oTextbox.onfocus = function() { var _this = this; if (this.originalTextbox) { _this = this.originalTextbox; _this.dummyTextbox = this; this.parentNode.replaceChild(this.originalTextbox, this); _this.focus(); } Debug("input box '" + _this.name + "' focus"); _this.style.color = _this.getAttribute("old_color"); if (_this.value === curPlaceholder) _this.value = ""; }; oTextbox.onblur = function() { var _this = this; Debug("input box '" + _this.name + "' blur"); if (_this.value === "") { _this.style.color = "#c0c0c0"; _this.value = curPlaceholder; } }; } else { Debug("input box '" + oTextbox.name + "' does not have placeholder attribute"); } } else { Debug("browser has native support for placeholder"); } } function Debug(msg) { if (typeof _debug !== "undefined" && _debug) { var oConsole = document.getElementById("Console"); if (!oConsole) { oConsole = document.createElement("div"); oConsole.id = "Console"; document.body.appendChild(oConsole); } oConsole.innerHTML += msg + "<br />"; } } </script> </head> How can I make that happen? I rather not show that awful long code in the head.
  17. I have a multi-step form that offers different options of membership to users with the e-mail domain 'vip.co.uk' I finally have it working but have hit a wall with pulling the variables together to form an URL that can be submitted to the payment gateway in the final step. The variables I need to pass are username, password, email, subscription id (a value attached to a radio button in step 2 - not yet built it). I have a JS fiddle at http://jsfiddle.net/zsasvoo4/15/. The final form will be in PHP and I'd prefer to use that language.
  18. hi I am having problems trying to either include php file or execute a php script within <div with a class> which I use for a drop down menu, every bit of help much appreciated, thanks..singhy <h2 class="hidenextdiv"><a href="#">dropdown menu1</a></h2> <div class="another dropmenuclass"> <h3>Test</h3> want to add my php working code here, have tried includes but no joy, it either breaks the dropdown menu or I am not getting the results back from the database, my script works ok, have tested it separately. <h3> </h3> <div style="clear: both;"> </div> </div>
  19. Hi. I'm trying to achieve a calendar that only uses PHP and CSS. I registered today to ask for help (because I'm not a coder; I'm just another clueless musician). My goal is to just skip the database, altogether. I've already, so far, skipped the Javascript, as well. I have an HTML non-functioning mockup HERE that's a bit "off" cosmetically, but I'm just using it as an example. It has a made-up "event" on August 16. I'm just using a little "tooltip" CSS. (I have no idea how it works in IE, it's just me and my MacBook here, but still... you get the idea of the function.) Or I might use THIS to get it to work for IOS, but that needs a little aesthetic work. Not tinkering with all that today. Now... my PHP created calendar, that I will actually be using, is HERE. All the structure of the calendar is echoed in PHP so there is no actual HTML hard coding of table cells. In fact, the only HTML within the body is <body></body> So, I can't very well just pick a date and type in some tags and be off. My question is this (and because I don't really know correct PHP jargon to formulate a question, I'm not being successful at Googling): Is it possible to use PHP to isolate a specific date, say, in this case, August 16 2014, and then, based upon that date existing, echo what I have hard-coded into the mockup example: <div class="has-tooltip"> Event <span class="tooltip">Concert In The Park<br /> 123 City Park Drive<br /> AnyTown, STATE 00000<br /> <a href="http://example.com" target="_blank">More Info</a><br /> or call 555.123.4567<br /></span> </div> I realize that this means that there's always a great chance of error, but this wouldn't be a calendar with any other users inserting dates; it's nothing more than an occasional event and then it's over, and I would be the one posting the events, so I'd be able to test it before publishing it. Possible? And if so, would you advise as how to get PHP to isolate a particular date and then echo the HTML and, of course, have it reside in the date-appropriate table cell? (I've managed to echo HTML to build the calendar structure, but I've never created an echo in conjunction with calling for a specific date. I'd appreciate any help and thanks so much. PHP: <?php $currMonth = isset($_GET['month']) ? $_GET['month'] : date('n'); $currYear = isset($_GET['year']) ? $_GET['year'] : date('Y'); $today = (($currYear == date('Y')) && ($currMonth == date('n'))) ? date('j') : 0; $prevMonth = $currMonth==1 ? 12 : $currMonth-1; $nextMonth = $currMonth==12? 1 : $currMonth+1; $prevYear = $currMonth==1 ? $currYear-1 : $currYear; $nextYear = $currMonth==12? $currYear+1 : $currYear; $day1 = mktime(0,0,0,$currMonth,1,$currYear); $dim = date('t', $day1); $dayN = mktime(0,0,0,$currMonth,$dim,$currYear); $dow1 = (date('w',$day1)+0) % 7; $dowN = (date('w',$dayN)+0) % 7; $calHead = date('F Y',$day1); echo <<<EOT <div class="calwrapper"> <div class="caltitle"><h1>Calendar</h1></div> <div class="container"> <div class="fnl first"></div> <div class="adjust"></div> <div class="fnl last"></div> </div> <div class="caldisplay"> <table cellspacing="0"> <tr> <td class="hd"><a class="cal_button" href="$_SERVER[php_SELF]?year=$prevYear&month=$prevMonth"> Prev </a></td> <td colspan="5" class="adjust">$calHead</td> <td class="hd"><a class="cal_button" href="$_SERVER[php_SELF]?year=$nextYear&month=$nextMonth"> Next </a></td> </tr> <tr> <th class="we">Sun</th> <th class="wd">Mon</th> <th class="wd">Tue</th> <th class="wd">Wed</th> <th class="wd">Thu</th> <th class="wd">Fri</th> <th class="we">Sat</th> </tr> <tr> EOT; for ($d=0;$d<$dow1;$d++) echo "<td class=\"hd\"> </td>"; $c = $dow1; for ($d=1; $d<=$dim; $d++, $c++) { if ($c%7==0) echo "</tr><tr>"; $cl = ($c%7==5) || ($c%7==6) ? 'we' : 'wd'; $st = ($d == $today) ? "style='padding: 0px;'" : ''; echo "<td class=\"$cl\" $st>\n"; echo "$d" ; echo "</td>\n"; } while ($c++ % 7 != 0) echo '<td class=\"hd\"> </td>'; echo "</tr></table>\n"; echo '</div></div>'; ?>
  20. From my experience, using Google's sitemap generator to generate a sitemap is not that good. It creates page that you do not want to show up. I am wondering what the best method is for creating a sitemap of a website so that only certain pages of the website show up on Google?
  21. I have a dynamic script and need to create a click event function with JavaScript to delete the row which has a checkbox checked when the delete button is pressed. This is being implemented with PHP and as now serves as light code for this matter at hand. I was only able to delete all rows. I have my efforts with the js functions too. <script type="text/javascript"> var counter = 1; var limit = 6; function addTextArea() { if (counter == limit-1) { alert("Maximum limit " + counter + " sorry"); return false; } else { <!-- CAUTION THIS IS BACKWARDS. --> var newdiv = document.createElement('div'); newdiv.innerHTML = "" + (counter + 1) + " <br><textarea name='fav_det[]' id=counter rows='3' cols='20'>"; document.getElementById('div6').appendChild(newdiv); var newdiv = document.createElement('div'); newdiv.innerHTML = "" + (counter + 1) + " <br><textarea name='fav_col' id=counter rows='3' cols='20'>"; document.getElementById('div5').appendChild(newdiv); var newdiv = document.createElement('div'); newdiv.innerHTML = "" + (counter + 1) + " <br><textarea name='fav_mod[]' id=counter rows='3' cols='20'>"; document.getElementById('div4').appendChild(newdiv); var newdiv = document.createElement('div'); newdiv.innerHTML = " " + (counter + 1) + " <br><input type='text' name='truck[]' id=counter>"; document.getElementById('div3').appendChild(newdiv); var newdiv = document.createElement('div'); newdiv.innerHTML = " " + (counter + 1) + " <br><input type='text' name='car[]' id=counter>"; document.getElementById('div2').appendChild(newdiv); var newdiv = document.createElement('div'); newdiv.innerHTML = "" + (counter + 1) + " <br><input type='checkbox' name='chk[]' id=counter>"; document.getElementById('div1').appendChild(newdiv); counter++ return true; } } </script> <script type="text/javascript"> function deleteRowS(dataTable) { for (var rowi= table.rows.length; rowi-->0;) { var row= table.rows[rowi]; var inputs= row.getElementsByTagName('dataTable'); for (var inputi= inputs.length; inputi-->0;) { var input= inputs[inputi]; if (input.type==='checkbox' && input.checked) { row.parentNode.removeChild(row); break; } } } } </script> <script type="text/javascript"> function deleteRow() { var table = document.getElementById(tableID).tBodies[0]; var rowCount = table.rows.length; // var i=1 to start after header for(var i=1; i<rowCount; i++) { var row = table.rows; // index of td contain checkbox is 8 var chkbox = row.cells[6].getElementsByTagName('input')[0]; if('checkbox' == chkbox.type && true == chkbox.checked) { table.deleteRow(i); } } }</script> </head> <table> <tr><td valign='top'><b>NEED DELETE ROW WITH CHECKBOX FUNCTION:</td></tr> </table> <table id="dataTable" width="auto" style="margin:-4px 0 0 0; padding:14px 0 0 0;" cellspacing="10px"><tbody id="dataTable"></tbody> <tr> <td valign='Top'> ✗ <div id="div1"> <input type="checkbox" name="chk[]" autocomplete="off" id="1" > </div> </td> <td valign='Top'> cars <div id="div2"> <input type="text" name="car[]" id="2" > </div> </td> <td valign='Top'> trucks <div id="div3"> <input type="text" name="truck[]" id="3" > </div> </td> <td valign='Top'> your favorite model <div id="div4"> <textarea name="mod[]" id="4" rows="3" cols="20"></textarea> </div> <br><br> </td> <td valign='Top'> your favorite add-ons <div id="div5"> <textarea name="fav_col" id="5" rows="3" cols="20"></textarea> </div> </td> <td valign='Top'> explain vehicle overall <div id="div6"> <textarea name="fav_det" id="6" rows="3" cols="20"></textarea> </div> </td> </tr> </table> <input type="button" value="Add another" onClick="addTextArea();" /> <input type="button" value="Delete row" onclick="deleteRow('dataTable');deleteRowS('dataTable')" />
  22. i have made a simple header page for a project. now i want to create a dropdown menu for a single menu item in the menu bar. how i will do that ..?? for ex-under COURSES MENU, THE SUBMENU ARE : DEGREE,DIPLOMA,HIGHSCHOOL.
  23. Hi I've inherited a form that sends the basic text email for output. I want to style this with html so the output forms into two columns in a table. I can see how others have incorporated html into their php script, but can't work out how to do it for the coded forms I have. See code below. $diyf_today = date("jS F Y"); $diyf_subject = "Staff and Student Room Booking Request"; $diyf_feedback = " Student Number: $studentno \r\n School, College or Unit: $unit \r\n Name: $name \r\n Email: $email \r\n Phone: $phone \r\n Event: $event \r\n Event Description: $eventdesc \r\n Event Date: $eventdate \r\n Event Time: $eventtime \r\n Location: ".implode(', ', ${'location[]'})." \r\n If external location: \r\n - External Name of location: $extname \r\n - External Contact Person: $extperson \r\n - External Contact Email: $extemail \r\n - External IP Address: $extIP \r\n \r\n Number Attending: Coffs $coffs; GC $gc; Lismore $lismore; NMSC $nmsc; THSS $thss; External $ext \r\n Do you require videolink: $videolink \r\n Location of videolink: $videolocation \r\n Do you require recording: $recorded \r\n Do you require additional AV equipment and support: $av \r\n - Type of equipment and support: $equip \r\n Do you require additional support: $support \r\n - Type of additional support: $support1 \r\n Additional Comments: $comment "; $diyf_mailTo = "luke.davis@scu.edu.au"; $diyf_mailSubject = stripslashes($diyf_subject); $diyf_mailBody = stripslashes($diyf_feedback); $diyf_mailBody .= "\r\n\r\nThis Room Booking Request form was sent from the Student website on the $diyf_today \r\nReturn Email: $email"; // Do not allow anything in here but valid emails, MUST pass through email validation, DO NOT put anything else in here!!! $diyf_mailHeader= "From: $email\r\n" . "Reply-To: $email\r\n" . "X-Mailer: PHP/" . phpversion(); $diyf_mailHeaderToUser= "From: $diyf_mailTo\r\n" . "Reply-To: $diyf_mailTo\r\n" . "X-Mailer: PHP/" . phpversion(); $sent = mail($diyf_mailTo,$diyf_mailSubject,$diyf_mailBody,$diyf_mailHeader); $returned = mail($email,$diyf_mailSubject,$diyf_mailBody,$diyf_mailHeaderToUser); if (!$sent || !$returned) { echo '<body><center><br><br><font face=verdana color="Gray"> Sorry, There was a problem submiting your form.<br> Please use your browser\'s back button and re-submit the form.</font></center></body>'; } else { echo ' ';// This gets around the PHP bug for self submitting forms submitting twice on redirect. stupid bugs header("Location: $diyf_success_page"); }
  24. Hello everybody, This is my first post here and I am beginner in PHP world in terms of writing the code to serve my own purposes. Well I am building a web app and basically it's a calendar which pulls information from .js file. Now I have thinking for the past couple of days how can I accomplish that each user that registers on the site manipulates its own .js file because information from .js file will be shown on calendar. Let me tell you how it's currently set up: 1. JavaScript file with particular static name is called under the script that is placed on index.php and the data is displayed on the page itself. So I would love to have is set it up like this: 1. Index page contains login form - Each registered/logged in user will have its own session 2. User registers and based on username/email new .js file is created out of a blank template and it is named based on user's username 3. user is then redirected to the calendar index which contains javascript that cals out that appropriate .js file based on the what user is logged in and displays data to the calendar I am not sure if that is doable with PHP or not but that's my thinking how it can be done if it's doable. I am open for any kind of suggestions how all this can be put together and if you do have better ideas I would love to hear from you.
  25. finder.com.au is making waves in the comparison space, and we are expanding our Design & Technology team massively this year. We are looking for several full-stack Senior PHP Developers who will be responsible for building a wide variety of web-based applications (using PHP and MySQL) in addition to maintaining existing PHP code, optimizing website and database performance and developing custom PHP solutions. This is a great opportunity for web people at heart to join a growing team delivering awesome products that get used by hundreds of thousands of users. As a developer at finder.com.au you will have the freedom, autonomy, and responsiblity to improve the code, tools, and architecture without having to cut through red tape. Why finder.com.au? We've just been named one of the top service companies in the Asia Pacific for 2014, taking silver in the Stevie Awards for Australian Service Company of the year. We’ve also been dubbed one of Anthill’s 50 coolest companies in Australia for 2013 thanks to our amazing team, wonderful users and cool company culture. As a development team, we move quickly, releasing code several times per day. You need to be willing to move fast, rely on automation, make decisions on less than perfect information, trust your teammates, and constantly strive to improve. A new Head of Design and Technology, with experience at two of local startup scene’s biggest success stories, recently joined us to lead the team on a mission to speed up the entire company to become the Australian brand for comparison. The team runs hackdays every other month that give all developers free time to show off their creativity and innovation. You will have choice of OS, laptop or desktop, IDE and toolset, and up to 3 monitors. What’s more, you will experience an ultra modern office located in the heart of the Sydney CBD, catered lunches and breakfast supplied every day and all the snacks and drinks you want! Who are you? You live and breathe development and your code has soul. You are a great PHP coder that wants to join a team where you can flex your skills and grow further. You are an expert who understands complex problems and enjoys deploying solutions to business problems. You are keen to get your projects live and solve business problems and improve the development environment and tooling. You also have experience in getting code live multiple times per day. You may be applying from overseas – We are happy to provide support with sponsored relocation services. We already have a number of people on our team from overseas so you will be joining a community. Must have experience: 4+ years of PHP development experience for Senior Roles Experience with phpunit Knowledge of CI tools (Bamboo, Travis, CircleCI) Knowledge of CD tools (Beanstalk, Capistrano) Knowledge of Git Ability and desire to use and extend Git tools (GitHub, Bitbucket) to enhance workflow Ability to mentor junior developers Experience with Wordpress beneficial Knowledge of Front End technologies beneficial Knowledge of monitoring tools beneficial Please send us a resume to iwantin@finder.com.au and optionally provide us with a link to your GitHub or Bitbucket profile and a personal note as to why you would want to work with us at finder.com.au.
×
×
  • 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.