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. here is my insert method public function add($values) { $sql = "insert into vehicles(`vehicle_plates`,`DA`,`type`, `model`, `driver`) values('$values')"; if(!mysql_query($sql)) { $this->error = mysql_error(); return true; } else { return false; } } And here is my Button click funtion $( "#button" ).button(); $( "#button" ).click(function( event ) { <?PHP if(isset($_POST["subBtn"])) { $fName = $g->clean($_POST["fullname"],1); $sDate = date('Y-m-d', strtotime($_POST["startdate"])); $roomNum = $g->clean($_POST["roomnumber"]); $driver = $g->clean($_POST["driver"],1); $model = $g->clean($_POST["model"],1); $json = '{"a":$fName, "b":$sDate, "c":$roomNum, "d":$model, "e":$driver}'; $array = json_decode($json, true); $values = implode(",", $array); $g->add($values); } ?> }); Everytime i click my button it Postsback and nothing inserts in my database...
  2. Here's my script $( "#button" ).button(); $( "#button" ).click(function( event ) { <?PHP ... ?> }); And here's the input tag <input id="button" type="submit" value="Add" name = "subBtn" /> Whenever i click the button it triggers postback how can i avoid this?
  3. I just want to know if there are any websites out there that i can upload an html file and a php3 file and have it enable the php3 host.
  4. if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM Request"); echo "<table border='1'> <tr> <th>First Name</th> <th>Last Name</th> <th>Prayer Request</th> <th>Deactivate Request</th> </tr>"; while($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['Reg_F_Name'] . "</td>"; echo "<td>" . $row['Reg_L_Name'] . "</td>"; echo "<td>" . $row['Reg_Request'] . "</td>"; echo "<td><input name=\"checkbox[]\" type=\"checkbox\" id=\"checkbox[]\" value=\"".$rows['Reg_ID']. "\" /></td>"; echo "</tr>"; } echo "</table>"; echo "<form action='' method='post'> <input type='submit' name='use_button' value='Update' /> </form>"; if(isset($_POST['use_button'])) { echo "Updated"; $update_id = $_POST['checkbox']; foreach($update_id as $value){ $sql = "Update Request set Reg_Status=0 WHERE Reg_ID='".$value."'"; $result = mysql_query($sql); } } mysqli_close($con); ?> the database is not updated when i click update.
  5. Hi, I working on a html table and want to get row wise information of that. please check the attachment. this is my code <?php //if(isset($_POST['submit'])) // { include ("db.php"); $query_for_result=mysql_query("SELECT * FROM pro_production ORDER BY production_id"); $num=mysql_numrows($query_for_result); //echo <<<end //<table align="right" > //<tr> //<td bgcolor="#6f0d00" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; padding:3px 5px 3px 5px; color:#FFFFFF;" >Total Result Search</td><td> </td><td bgcolor="#000000" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; padding:3px 5px 3px 5px; color:#FFFFFF;">$num</td> //</tr> //</table> //end; mysql_close(); ?> <div id="main" style="width: 100%; float:left; border:solid #CCCCCC; background-color:#FFFFFF; overflow:scroll; height:500px;"> <table width="1800" align="center" border="1" cellspacing="0" cellpadding="0" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; color:#000000; border:solid #d6d4d5; border-width:1px; margin-top:0px;"> <tr> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >S.No.</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Booking Date</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Delivery Date</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Order Number</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Customer Name</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Status</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Product Range</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Cover</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Size</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Accessory</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Bag</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Packing</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Delivery</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Paper</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Coating</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Priority</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Advance</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >G Total</td> <td valign="top" style="font-size:11px; background:#87bb2f; font-weight:bold;" align="center" >Balance</td> </tr> <?php $i=0; while ($i < $num) { $f1=mysql_result($query_for_result,$i,"production_id"); $f2=mysql_result($query_for_result,$i,"booking_date"); $f3=mysql_result($query_for_result,$i,"delivery_date"); $f4=mysql_result($query_for_result,$i,"order_no"); $f5=mysql_result($query_for_result,$i,"salutation"); $f6=mysql_result($query_for_result,$i,"customer_name"); $f7=mysql_result($query_for_result,$i,"status"); $f8=mysql_result($query_for_result,$i,"product_range"); $f9=mysql_result($query_for_result,$i,"cover"); $f10=mysql_result($query_for_result,$i,"size"); $f11=mysql_result($query_for_result,$i,"accessory"); $f12=mysql_result($query_for_result,$i,"bag"); $f13=mysql_result($query_for_result,$i,"packing"); $f14=mysql_result($query_for_result,$i,"delivery"); $f15=mysql_result($query_for_result,$i,"coating"); $f16=mysql_result($query_for_result,$i,"priority"); $f17=mysql_result($query_for_result,$i,"advance"); $f18=mysql_result($query_for_result,$i,"gtotal"); $f19=mysql_result($query_for_result,$i,"balance"); $f20=$f5.$f6; $f21=mysql_result($query_for_result,$i,"paper"); $id=$i+1; ?> <!--<tr onclick="myFunction(this)">--> <tr > <!--<td valign="top" style="font-size:11px; " align="center" ><?php echo htmlentities($f1); ?></td>--> <td valign="top" style="font-size:11px; " align="center" ><?php echo $id; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f2; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f3; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f4; ?></td> <!--<td valign="top" style="font-size:11px; " align="center" ><?php echo $f5; ?></td>--> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f20; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f7; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f8; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f9; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f10; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f11; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f12; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f13; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f14; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f21; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f15; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f16; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f17; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f18; ?></td> <td valign="top" style="font-size:11px; " align="center" ><?php echo $f19; ?></td> </tr> <?php $i++; } ?> </table> </div> What i want that if i select row first and the click on any of the bottom buttons then i could get the whole information of that row. I have done lot of search but i only able to get the data when click on the row itself but not when i clicked on the bottom button, So if any one can help me in this regard then i will be very thankful. thanks
  6. I want to include Indian language in html page [Tamil, telegu, kannada,bengali, gujrati, hindi, punjabi language] If I select one language, the complete must be translated automatically in that particular selected language. <select name=’_lang_’> <option>Tamil</option> <option>Telegu</option> <option>Kannada</option> <option>Bengali</option> <option>Gujrati</option> <option>Hindi</option> <option>Punjabi</option> </select> Can you provide a certain feature to my webpage by which I can make translation easily? If you having doubt in understanding my requirement, please feel free to ask anytime
  7. Normally you would add unique meta tags(title, description) for each page of the website. However, what if it's a user based website where a user can add posts with title and description? Is it better to add user's title/post name in the meta tags or keep it as your own?
  8. im having a simple html form that gets variables via 'POST' and passes them to simple.php, the simple.php file constructs a new link with the $_POST[] - and all i want to do is creating a simple iframe (this script is only for internal uses) underneath the form that will open the new link that was created within simple.php to clarify it a bit more here's form.html <form name="Students Management" action="http://myowntest.com/simple.php" method="post" accept-charset="utf-8"> <p> <label>First Name</label> <input type="text" value="" name="firstname" ></input> </p> <p> <label>Phone</label> <input type="text" value="" name="phone" ></input> </p> <p> <label>Last Name</label> <input type="text" value="" name="lastname" required="true"></input> </p> <p> <label>Company</label> <input type="text" value="" name="school" required="true"></input> </p> <p> <label>Email</label> <input type="text" value="" name="email" ></input> </p> <p> <label>Country</label> <input type="text" value="" name="age" ></input> </p> <p> <input type="submit" value="Submit" ></input> </p> </form> and here's simple.php <?php $newUrl = 'http://www.myothertestspace.com/simlpe2.php?name=' . $_POST['name'] . '&surname=' . $_POST['lastname'] . '&phone=' . $_POST['phone']; header(Location: $newUrl); ?> now, all i want is - after the user 'submits' the details on form.html , i'd like a new iframe will be shown up in the same page as the form that will show the user the contents of simple.php (which means - myothertestspace.com with the new parameters). thanks a lot!
  9. Hey, I'm pretty new to this site so I thought I would try it out! You never know!... I am currently building a private messaging system on my website, it's a lot of code so I will try to cut it down, if you require anymore code to help me out, please let me know and I will post it. The problem I am having, in your "inbox" the messages you have sent or received are displayed with the title of (SUBJECT). When you click the subject, you can see all the messages you or the other user have sent to each other. With first and last names. The 2 codes below gather this information from the databases, which is absolutely fine. Although, instead of showing the (SUBJECT) on the inbox page, i would prefer to show the (FIRST NAME + LAST NAME) of who the message is to or from. Just like you can see in the actual message itself. I cannot figure out how to do this. The second code below does this for the view message page, although the top code gathers information for the inbox page, I have tried my best to combine the users info from the 2nd part to the 1st part, but all this does is show every message as the logged in users first and last names, not who the message is sent to or received from, is there a way to do this? Here are the 2 codes: <?php function fetch_conversation_summery(){ $sql = "SELECT `conversations`.`conversation_id`, `conversations`.`conversation_subject`, MAX(`conversations_messages`.`message_date`) AS `conversation_last_reply`, MAX(`conversations_messages`.`message_date`) > `conversations_members`.`conversation_last_view` AS `conversation_unread` FROM `conversations` LEFT JOIN `conversations_messages` ON `conversations`.`conversation_id` = `conversations_messages`.`conversation_id` INNER JOIN `conversations_members` ON `conversations`.`conversation_id` = `conversations_members`.`conversation_id` WHERE `conversations_members`.`userid` = {$_SESSION['userid']} AND `conversations_members`.`conversation_deleted` = 0 GROUP BY `conversations`.`conversation_id` ORDER BY `conversation_last_reply` DESC"; $result = mysql_query($sql); $conversations = array(); while (($row = mysql_fetch_assoc($result)) !== false){ $conversations[] = array( 'id' => $row['conversation_id'], 'subject' => $row['conversation_subject'], 'last_reply' => $row['conversation_last_reply'], 'name' => $row['first_name'], 'unread_messages' => ($row['conversation_unread'] == 1), ); } return $conversations; } function fetch_conversation_messages($conversation_id){ $conversation_id = (int)$conversation_id; $sql = "SELECT `conversations_messages`.`message_date`, `conversations_messages`.`message_date` > `conversations_members`.`conversation_last_view` AS `message_unread`, `conversations_messages`.`message_text`, `users`.`first_name`, `users`.`last_name` FROM `conversations_messages` INNER JOIN `users` ON `conversations_messages`.`userid` = `users`.`userid` INNER JOIN `conversations_members` ON `conversations_messages`.`conversation_id` = `conversations_members`.`conversation_id` WHERE `conversations_messages`.`conversation_id` = {$conversation_id} AND `conversations_members`.`userid` = {$_SESSION['userid']} ORDER BY `conversations_messages`.`message_date` DESC"; $result = mysql_query($sql); $messages = array(); while (($row = mysql_fetch_assoc($result)) !== false){ $messages[] = array( 'date' => $row['message_date'], 'unread' => $row['message_unread'], 'text' => $row['message_text'], 'first_name' => $row['first_name'], 'last_name' => $row['last_name'], ); } return $messages; } I need to be able to recall the information as "$coversation['first_name']; $conversation['last_name']" to show the names, although this information is only available on the messages page as "$messages['first_name'];. I am currently displaying the subject as "$conversation['subject'];". Trying to turn subject into the first and last names. Files have been attached for reference. Thanks pmsettings.php inbox.php viewmessage.php
  10. Hi I am trying to create a grid like gallery and for some reason it does not look right? I want it to look like pinterest so I am trying to use wookmark jquery. Here is my code and an image to view. Thank you. Here is the css: #gallerycontainer { display: inline-block; background-color: #f0f0f0; padding: 0px; width:850px; /*border: 1px solid #DBDBDB; -webkit-box-shadow: #E4E4E4 0px 0px 5px; -moz-box-shadow: #E4E4E4 0px 0px 5px; box-shadow:#E4E4E4 0px 0px 5px;*/ position:relative; left:0px; bottom:13px; overflow:inherit; top:0px; float: left; padding-right: 0px; margin-left: 10px; overflow: auto; } #gallery{ } #gallery li img { float: left; border: 5px solid #fff; -webkit-transition: box-shadow 0.5s ease; -moz-transition: box-shadow 0.5s ease; -o-transition: box-shadow 0.5s ease; -ms-transition: box-shadow 0.5s ease; transition: box-shadow 0.5s ease; max-width:250px; max-height:200px; padding:0px; } .galleryinfo{ border: 2px solid #fff; padding-bottom: 40px; float: left; margin:9px; background: white; } #gallery li img:hover { -webkit-box-shadow: 0px 0px 7px rgba(255,255,255,0.9); box-shadow: 0px 0px 7px rgba(255,255,255,0.9); cursor: pointer; } .myaccounttitle{ text-align: center; } And here is the php and html. <script type="text/javascript" src="js/jquery.wookmark.js"></script> <script type="text/javascript">$('#gallery li').wookmark();</script> <div class="myaccounttitle">My Images</div> <div id="gallery"> <?php function pictures($query) { while($row = mysql_fetch_array($query)) { $id = $row['id']; $title = $row['title']; $author = $row['userid']; $date = date("F j, Y, g:i a", $row['date']); $picture = $row['picture']; // $likes = $row['likes']; // $favs = $row['favs']; $unique = mysql_num_rows(mysql_query("SELECT * FROM views WHERE picture='$id' GROUP BY ip")); ?> <div class="galleryinfo"> <li id="<?php print $id?>"> <a class="fancybox" rel="group" href="photos/<?php print $picture?>"><img src="photos/<?php print $picture?>"/></a> </li> Views : <?php print($unique) ?> </div> <?php }}} ?> <div id="gallerycontainer"> <?php if($account == "c") { pictures($query2); }else { pictures($query); } ?> </div> All of your help is greatly appreciated.
  11. Hello ! I'm new on this board and I need your help ! I explain you my problem. I'd like to collect the content of around 1000 URL in a textfile (I use the wget function in a bash). And then I want to parse this textfile in order to pick one type of content up in a csv file. 1) So my bash is this one : file=/home/julien/tests/file.txt for i in $(cat $file) do wget $i -O ->> songs_t.txt; done It works perfectly and the textfile songs_t.txt is well created. That textfile contains the content of the 1000 URLs. 2) Then I make a php script to parse songs_t.txt. I only want to get concert setlists (the setlist is only a part of a the content of each URL). So my approach is to remove tags such as 'a', 'h4', 'Title' and so on and save the rest in a csv file called 'SONGS.csv' An example of a URL can be seen here : http://members.tripod.com/~fun_fun_fun/8-17-63.html My part of the php script dealing with the parsing is this one : $html = file_get_html('songs_t.txt'); foreach ($html->find('title, script, div, center, style, img, noscript, h4, a') as $es) $es->outertext = 'title, script, div, center, style, img, noscript, h4, a'; $f = fopen('SONGS.csv', "w"); fwrite ($f, $html); fclose($f); The script works for the 35 first URL (I nearly only get the setlists) but as soon as the script has to deal with more than 35 URL, I have the following error message : Call to a member function find() on a non-object in /home/julien/tests/boys2.php on line 23. That line 23 corresponds to : foreach ($html->find('title, script, div, center, style, img, noscript, h4, a') as $es) 3) In order to test if my html object is valid, I use that code : html = file_get_html('songs_t.txt'); if (!is_object($html)){ echo "invalid object"; } And the result is "invalid object". This test is made in a textfile composed of the content of 50 URL. But when I apply that test on textfile composed of 30 URL, I have no error ! So how can I do to parse my HTML even if it's not a entire valid object ? Could you help me please ? Thanks !
  12. I'm having a bit of trouble with a PHP contact form. There are issues with the error messages not showing on the form, the form not resetting, and the "name" input appearing as "X-AuthUser: XXX123 (which happens to be my FTP user name which I'm keeping private) when the email is sent to my gmail account. This is how the theme should look: http://pluto.html.themewoodmen.com/07-pluto-contact.html And this is what I have: http://divagraphics.us/test/contact.html The HTML <div class="contactForm"> <div class="successMessage alert alert-success alert-dismissable" style="display: none"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> Thank You! E-mail was sent. </div> <div class="errorMessage alert alert-danger alert-dismissable" style="display: none"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> Ups! An error occured. Please try again later. </div> <form class="liveForm" role="form" action="form/send.php" method="post" data-email-subject="Contact Form" data-show-errors="true" data-hide-form="false"> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="control-label">Name <span>(Required)</span></label> <input type="text" required name="name" class="form-control" id="name"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="control-label">Email <span>(Required)</span></label> <input type="email" required name="email" class="form-control" id="email"> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="form-group"> <label class="control-label">Subject</label> <input type="text" name="subject" class="form-control" id="subject"> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="form-group"> <label class="control-label">Message <span>(Required)</span></label> <textarea name="message" required class="form-control" rows="5" id="message"></textarea> </div> </div> </div> <input type="submit" class="btn btn-primary" value="Send Message"> </fieldset> </form> </div> The JS /** * Contact Form */ jQuery(document).ready(function ($) { "use strict"; $ = jQuery.noConflict(); var debug = false; //show system errors $('.liveForm').submit(function () { var $f = $(this); var showErrors = $f.attr('data-show-errors') == 'true'; var hideForm = $f.attr('data-hide-form') == 'true'; var emailSubject = $f.attr('data-email-subject'); var $submit = $f.find('[type="submit"]'); //prevent double click if ($submit.hasClass('disabled')) { return false; } $('[name="field[]"]', $f).each(function (key, e) { var $e = $(e); var p = $e.parent().find("label").text(); if (p) { var t = $e.attr('required') ? '[required]' : '[optional]'; var type = $e.attr('type') ? $e.attr('type') : 'unknown'; t = t + '[' + type + ']'; var n = $e.attr('name').replace('[]', '[' + p + ']'); n = n + t; $e.attr('data-previous-name', $e.attr('name')); $e.attr('name', n); } }); $submit.addClass('disabled'); $f.append('<input class="temp" type="hidden" name="email_subject" value="' + emailSubject + '">'); $.ajax({ url: $f.attr('action'), method: 'post', data: $f.serialize(), dataType: 'json', success: function (data) { $('span.error', $f).remove(); $('.error', $f).removeClass('error'); $('.form-group', $f).removeClass('has-error'); if (data.errors) { $.each(data.errors, function (i, k) { var input = $('[name^="' + i + '"]', $f).addClass('error'); if (showErrors) { input.after('<span class="error help-block">' + k + '</span>'); } if (input.parent('.form-group')) { input.parent('.form-group').addClass('has-error'); } }); } else { var item = data.success ? '.successMessage' : '.errorMessage'; if (hideForm) { $f.fadeOut(function () { $f.parent().find(item).show(); }); } else { $f.parent().find(item).fadeIn(); $f[0].reset(); } } $submit.removeClass('disabled'); cleanupForm($f); }, error: function (data) { if (debug) { alert(data.responseText); } $submit.removeClass('disabled'); cleanupForm($f); } }); return false; }); function cleanupForm($f) { $f.find('.temp').remove(); $f.find('[data-previous-name]').each(function () { var $e = jQuery(this); $e.attr('name', $e.attr('data-previous-name')); $e.removeAttr('data-previous-name'); }); } }); The PHP <?php // Contact subject $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $message = $_POST['message']; $to = "divagraphicsinc@gmail.com"; $from = $_POST['email']; $headers = "From: $from"; mail($to,$subject,$message,$headers) ?>
  13. Hello everyone, I am new to php coding and i am currently trying to check for duplicate data when inserting new values (i.e. a question) in mysql database table. I keep getting this error 'Warning: mysqli_num_rows() expects exactly 1 parameter,2 given in'. Below is the code i am currently working with. Thanks in advance <?php session_start(); $link = mysqli_connect("elephant.ecs.westminster.ac.uk", "w1268094", "euMm27FZwZDK", "w1268094_0"); ?> <?php //Error reporting due to long script error_reporting(E_ALL); ini_set('display_errors','1'); ?> <?php ob_start(); //Add question to table If (isset($_POST['question'])) { $question = mysqli_real_escape_string($link, $_POST['question']); $date = mysqli_real_escape_string($link, $_POST['questiondate']); //See if question is identical to another question in the table $sql = mysqli_query($link,"SELECT pQuestionNo FROM presidentQuestion WHERE pQuestion='$question'LIMIT 1"); $questionMatch = mysqli_num_rows($link, $sql); //count the output amount if ($questionMatch>0){ echo 'Sorry you tried to place a duplicate "Question" into the table, <a href="inventory.php">Click here</a>'; exit(); } //Add the question to the database $sql = mysqli_query($link,"INSERT INTO presidentQuestion (pQuestion,pDate) VALUES ('". mysqli_real_escape_string($link, $question) ."','". mysqli_real_escape_string($link, $date) ."')") or die (mysqli_error($link)); header("location: inventory.php"); exit(); } ?> <?php //Grabs the whole queston list $question_list=""; $sql = mysqli_query($link,"SELECT * FROM presidentQuestion LIMIT 0,10") or die(mysql_error()); $questionCount = mysqli_num_rows($sql);// count the output amount if($questionCount>0){ while($row = mysqli_fetch_array($sql, MYSQLI_ASSOC)){ $question = $row["pQuestion"]; $date = $row["pDate"]; $question_list .= "$question <br/>"; } }else{ $question_list = "There are no questions in the inventory yet"; } ?> <?php $prop_id = $_GET['prop_id']; ?>
  14. I am running this query and the only thing i want is the title and for some reason it is giving me this. Recourse id # 7 ? Here is my query that i am running. $photo = $_GET['image']; $retrievetitle = "SELECT title FROM photo_from_user WHERE picture = '$photo' limit 1"; $title = mysql_query($retrievetitle);
  15. I need help with my code. I'm trying to make it so that when I hit the withdraw button the money is withdrawn and the new amount is shown in the text box. As of now, when I hit the money buttons the money is withdrawn. The withdraw button does nothing. I can't figure out what I did wrong. assignment7.html
  16. here is my code and i need help with why it is not letting people register or login. Once logged in i want it to take the logged in users to area.php. any help will be appriciated. <?php session_start(); ob_start(); //Include the database connection file include "config.php"; //Check to see if the submit button has been clicked to process data if(isset($_POST["submitted"]) && $_POST["submitted"] == "yes") { //Variables Assignment $username = trim(strip_tags($_POST['username'])); $user_password = trim(strip_tags($_POST['passwd'])); $encrypted_md5_password = md5($user_password); $validate_user_information = mysql_query("select * from `friendship_system_users_table` where `username` = '".mysql_real_escape_string($username)."' and `password` = '".mysql_real_escape_string($encrypted_md5_password)."'"); //Validate against empty fields if($username == "" || $user_password == "") { $error = '<br><div class="info">Sorry, all fields are required to log into your account. Thanks.</div><br>'; } elseif(mysql_num_rows($validate_user_information) == 1) //Check if the information of the user are valid or not { //The submitted info of the user are valid therefore, grant the user access to the system by creating a valid session for this user and redirect this user to the welcome page $get_user_information = mysql_fetch_array($validate_user_information); $_SESSION["VALID_USER_ID"] = $username; $_SESSION["USER_FULLNAME"] = strip_tags($get_user_information["fullname"]); header("location: area.php"); } else { //The submitted info the user are invalid therefore, display an error message on the screen to the user $error = '<br><div class="info">Sorry, you have provided incorrect information. Please enter correct user information to proceed. Thanks.</div><br>'; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>A Cool Login System With PHP MySQL &amp jQuery | Tutorialzine demo</title> <link rel="stylesheet" type="text/css" href="demo.css" media="screen" /> <link rel="stylesheet" type="text/css" href="login_panel/css/slide.css" media="screen" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <!-- PNG FIX for IE6 --> <!-- http://24ways.org/2007/supersleight-transparent-png-in-ie6 --> <!--[if lte IE 6]> <script type="text/javascript" src="login_panel/js/pngfix/supersleight-min.js"></script> <![endif]--> <script src="login_panel/js/slide.js" type="text/javascript"></script> </head> <body> <!-- Panel --> <div id="toppanel"> <div id="panel"> <div class="content clearfix"> <div class="left"> <p><img alt="" height="136" src="http://chatanrelax.co.uk/images/logo.gif" width="205" /></p> </div> <div class="left"> <!-- Login Form --> <center> <div class="vpb_main_wrapper"> <br clear="all"> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <div style="width:115px; padding-top:10px;float:left;" align="left">Your Username:</div> <div style="width:300px;float:left;" align="left"> <input type="text" name="username" id="username" value="" class="auto-style1" style="width: 223px"></div><br clear="all"><br clear="all"> <div style="width:115px; padding-top:10px;float:left;" align="left">Your Password:</div> <div style="width:300px;float:left;" align="left"> <input type="password" name="passwd" id="passwd" value="" class="auto-style1" style="width: 223px"></div><br clear="all"><br clear="all"> <div style="width:300px;float:left;" align="left"> <input type="hidden" name="submitted" id="submitted" value="yes"> <input type="submit" name="submit" value="Login" style="margin-right:50px;" class="bt_login"> </div> </form> <br clear="all"><br clear="all"> <div style="width:450px;float:left;" align="left"><?php echo $error; ?></div><br clear="all"> </div> </center> </div> <div class="left right"> <!-- Register Form --> <center> <div class="vpb_main_wrapper"> <br clear="all"> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <div style="width:115px; padding-top:10px;float:left;" align="left">Your Username:</div> <div style="width:300px;float:left;" align="left"> <input type="text" name="username" id="username" value="<?php echo strip_tags($_POST["username"]); ?>" class="vpb_textAreaBoxInputs" style="width: 223px"></div><br clear="all"><br clear="all"> <div style="width:115px; padding-top:10px;float:left;" align="left">Email Address:</div> <div style="width:300px;float:left;" align="left"> <input type="text" name="email" id="email" value="<?php echo strip_tags($_POST["email"]); ?>" class="vpb_textAreaBoxInputs" style="width: 223px"></div><br clear="all"><br clear="all"> <div style="width:115px; padding-top:10px;float:left;" align="left">Desired Password:</div> <div style="width:300px;float:left;" align="left"><input type="password" name="passwd" id="passwd" value="" class="vpb_textAreaBoxInputs" style="width: 223px"></div><br clear="all"><br clear="all"> <input type="submit" name="submit" id="" value="Register" class="bt_register"> <input type="hidden" name="submitted" id="submitted" value="yes"> </form> <br clear="all"><br clear="all"> <div style="width:450px;float:left;" align="left"><?php echo $error; ?></div><br clear="all"> </div> </center> <!-- Code Ends --> </div> </div> </div> <!-- /login --> <!-- The tab on top --> <div class="tab"> <ul class="login"> <li class="left"> </li> <li>Hello Guest!</li> <li class="sep">|</li> <li id="toggle"> <a id="open" class="open" href="#">Log In | Register</a> <a id="close" style="display: none;" class="close" href="#">Close Panel</a> </li> <li class="right"> </li> </ul> </div> <!-- / top --> </div> <!--panel --> <div class="pageContent"> <div id="main"> <div class="container"> </div> <div class="container"> <div class="clear"></div> </div> </div> </div> </body> </html>
  17. Hello everyone! I have just finished my first HTML/CSS class, so I have a lot left to learn. One of the unfortunate things that was not covered at all in my class was cross-browser compatability. I made my website where it looked good in Chrome, but had things broken in IE and FireFox. A friend suggested I try converting some of my 'loose html5 coding' to the more strict XHTML. Any feedback or suggestions would be very welcome overall, and specifically checking how this looks across browsers. I'm currently at work where I'm stuck using Win XP with IE7. It looks so broken on IE 7 I wouldn't know where to start. www.rusticspices.com/ (original project) www.rusticspices.com/xhtmltest.html (testing xhtml changes) xhtmltest.html
  18. I downloaded a free template from a website and I want to customize it in PHP but I don't know how. Here is a link to the files: http://deadshotcolada.net/megacorporate.zip I need someone to do this for me please. - I want to add a member's login on the left hand side of the page in the sidebar in the place of the sidebar menu (I want the menu moved down). I want it to show member links when logged in already (in the same format as the sidebar menu). - I want to swap the "Wise Words" section of the sidebar for an advertisement. (I will provide the advertisement so I just need a place for the html) - I want Facebook, Twitter, YouTube, and Google+ icons to the right of the menu items at the top that highlight the same way. (They will link to my pages) - I want to be able to make the form on the 'contact' page work and be able to customize it. - I want the buttons on the home page (the 1, 2, 3, page switching buttons) to be working and make it load more content on that same page. - I want the 'blog' section working so that members can leave replies if they have permission. - I want the 'image gallery' at the bottom of each page to show a random image from a list accompanied by a link that I provide for each image. (I also want to provide the images of course.) - I want an advertisement control page in an admin panel (mydomain.com/admin - allow me to change the path) that allows me to enter code for different ad dimensions and then insert each ad easier on each page. -I want member control from the admin panel. -I want template color control from the admin panel. -I want to be able to edit each and every page's content from the admin panel. -I want to be able to create new pages, upload images and files, and manage every aspect of a page from the admin panel. -I want members to have an area where they can upload files which I can download from the admin panel. -I want members to be able to pay a fee (via PayPal) to download a file. (I set the fee amount when uploading the file). -I want to be able to add a file download button to any page of the site that allows me to specify which file they download. (The file location cannot be revealed by looking at code). -I want to be able to make pages accessible by members only from the admin panel. -I want to be able to IP ban people. I also want to be able to block email addresses. -I want to be able to make it so that in order to download a file that does not have a fee, people must post about it on Facebook or Twitter and watch an advertisement first. (I set the time that they have to watch it for - from the admin panel) -I want to be able to have a mailing list that saves an email address when connecting to Facebook or Twitter and has member's email addresses saved in it. (No duplicates) (I must be able to view the list and send a mass email out from the admin panel). -All pages must load fast. I want images to be compressed when uploaded from the admin panel to reduce filesize but maintain image quality. (Image formats must stay the same as uploaded, just losslessly compressed.) -I want to be able to embed a YouTube video onto a page from the admin panel. (I supply the link. Dimensions are auto-fit unless specified.) -I want to be able to have individual favicons for each page, or the default if I don't upload one. -I want members to be able to upload a profile photo and add information about themselves. I want each member to have their own profile page. -I want misspelled words to be highlighted as in Microsoft Word. -I want a profanity filter (I set the words to filter) on all member content unless I turn it off from the admin panel. -I want to be able to manually add or edit member info and create new members as well as delete them. -I want to be able to track member usage. (Last login, last IP used, all IP's used, times logged in, members currently online, new members (today, this week, this month, this year), etc.) I also want to be able to track total website visits by the hour, day, week, month, year. -I want visitors to be able to share any page on Facebook, Twitter, Google+, etc by clicking a button. I believe that is all that I want done to this template. There is no rush on the time it needs to be done by, I just want it as soon as possible. I can pay for this to be done but I am limited on the amount. If everything I listed is added, I can pay around $100 USD for this given I see a demo first to make sure that it is the way I like it. Please contact me via email at support@devonmiller.net to discuss anything regarding this project. I can't have any bugs as I will be uploading this to a domain that gets hundreds of hits per day. This will be replacing my current template which can be seen at http://www.deadshotcolada.net/. Thanks!
  19. I am trying to create a forget password option. For some reason, it's not working. Please check the code below to see what is wrong with it. if(isset($_POST['submit'])) { if(!empty($_POST['email'])) { $email = escape($_POST['email']); $getData = DB::getInstance()->query("SELECT * FROM users WHERE email = {$email}"); if($getData->count()) { foreach($getData->results() as $row) { $username = escape($row->username); $full_name = escape($row->full_name); $password = escape($row->password); $db_email = escape($row->email); } } else { echo 'No data returned!'; } if($email == $db_email) { $new_password = substr(md5(rand(999, 999999)), 0, ; $to = $db_email; $subject = "Password Reset"; $body = "Hello " . $full_name . ",\n\nYour new password is: " . $new_password . "\n\n-Favecave"; $updatePass = DB::getInstance()->query("UPDATE users SET password = {$new_password} WHERE email= {$email}"); mail($to,$subject,$body); } else { echo 'Email not found'; } } else { echo 'Please enter field'; } } ?> <form action="" method="post"> <span>Enter your email address:<span><br> <input type="email" name="email" size="40"><br> <input type="submit" value="Recover"> </form>
  20. Javascript CODE: var m=n=0; function show_services() { m=m+1; n=m+1; if(m==6) {m=6;n=1;} if(m==7) {m=1;n=2;} str1 = "/images/pic" + m + ".PNG"; str2 = "/images/pic" + n + ".PNG"; document.getElementById('w1').innerHTML = str1; document.getElementById('w2').innerHTML = str2; document.getElementById('img1').src = str1; document.getElementById('img2').src = str2; } var my_str = setInterval(function() {show_services()},1000); ############################################################################## <img id="img1" src="/images/pic1.PNG" style="margin-top:30px" height="100px" width="550px"/><br> <img id="img2" src="/images/pic2.PNG" style="margin-top:30px" height="100px" width="550px"/><br> <br> <div id='w1'></div> <br> <div id='w2'></div> ############################################################################## the code is working fine, files have been placed at the right place, str1 and str2 are getting correct values and they are updating at the right time..............I run same code on browser and it works fine, but, when I run the same code on website domain, it does work at all, what can be the reason for this ............
  21. Hi all, I'm fairly new with PHP/HTML and I'm working on implementing a simple comment field for a website I'm designing. The issue I'm having is that the comment field seems to only display integers, and not strings. Other then not displaying words, I'm not getting any errors. The database seems to be working fine, however it's only saving Integers, and not Strings. I've checked the columns and the one which is holding the comments is using type "text", and the ID is "int". I don't believe the issue is with the table, but rather somewhere with the PHP. Here is the code below: <?php 02 mysql_connect("localhost","root","changeme"); 03 mysql_select_db("certestdb"); 04 $comment=$_POST['comment']; 05 $submit=$_POST['submit']; 06 07 08 $dbLink = mysql_connect("localhost", "root", "changeme"); 09 mysql_query("SET character_set_client=utf8", $dbLink); 10 mysql_query("SET character_set_connection=utf8", $dbLink); 11 12 13 14 if (!empty($_POST)) { 15 //$comment=$_POST['comment']; 16 //$submit=$_POST['submit']; 17 18 19 if($submit) { 20 if($comment) { 21 $insert=mysql_query("INSERT INTO comment (comment) VALUES ($comment) "); 22 } else { 23 echo "please fill out all fields"; 24 } 25 } 26 } 27 28 ?> 29 30 <html> 31 <head> 32 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 33 <title>Comment box</title> 34 </head> 35 <div style="width:100px; height:100px; margin: 2 auto;"> 36 <body> 37 <center> 38 <form name="comment.php" method="post" action=""> 39 <table> 40 <tr><td colspan="2">Comments: </td></tr> 41 <tr><td colspan="5"><textarea name="comment" rows="5" cols="150"></textarea></td></tr> 42 <tr><td colspan="2"><input type="submit" name="submit" value="Comment"></td></tr> 43 </table> 44 </form> 45 46 <?php 47 $dbLink = mysql_connect("localhost", "root", "changeme"); 48 mysql_query("SET character_set_results=utf8", $dbLink); 49 50 51 52 $getquery=mysql_query("SELECT * FROM comment ORDER BY id DESC"); 53 while($rows=mysql_fetch_array($getquery)) { 54 $id=$rows['id']; 55 $comment=$rows['comment']; 56 echo $comment . '<br/>' . '<br/>' . '<hr size="1"/>'; 57 } 58 59 ?> 60 61 </body> 62 </html> If anyone might know what is causing this and could help, it would be much appreciated! Thanks!
  22. Hi, I am a ZCE in PHP5. You can visit my profile at http://www.freelancer.com/u/phpopensource.html Thanks
  23. Hi all, I was wondering if you can help me with an issue I am having with my website. I am very new to php/html/css and mysql so I know very little. I have an order form on my website which when filled in send data to my database. I then have an admin page on my site which shows the data in the database. However, I need the data to be stored in a table with a row containing the column name and then each row showing the actual data underneath. Would like it in a grid sort of format. My current code is: <!doctype html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <link href="css/style.css" rel="stylesheet" type="text/css" /> <link href="css/reset.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="container2"> <div id="adminpanel"> Admin Page <div id="showorders"><u>Orders</u></div> <?php include('connection.php'); $result = mysql_query("SELECT * FROM orderform"); while($row = mysql_fetch_array($result)) { echo "<span style='color: #333; width: 200px; height: 200px; padding: 1px; border: 1px solid #ff9900;'>" . $row['product'] . " " . $row['productcomments'] . " " . $row['name'] . " " . $row['address'] . " " . $row['age'] . " " . $row['delivery'] . "</span>" ; echo "<br>"; } ?> <div id="showreviews"><u>Reviews</u></div> <?php $result = mysql_query("SELECT * FROM reviewform"); while($row = mysql_fetch_array($result)) { echo "<span style='color: #333; width: 200px; height: 200px; padding: 5px; border: 1px solid #ff9900;'>" . $row['name'] . " " . $row['product'] . " " . $row['comment'] . "</span>" ; echo "<br>"; echo $row['name'] . " " . $row['product'] . " " . $row['comment'] ; echo "<br>"; } ?> </div> </div> </body> This code puts a border around each row but doesnt seperate each column and doesnt show a header. Ultimately, I am going to want to sort each order by different criteria e.g alphabetical, date ordered, product type. All help is really appreciated as I am really pushed for time and a complete beginner. Thanks Jonathan
  24. as far i compare, mpdf is quite amazing, simple and easy. others conversion library is tcpdf, fpdf, dompdf, wkhtml2pdf.. so far, only fpdf and mpdf can convert the php to pdf. i try to convert a php form to pdf. for example when we want to book a flight ticket. after the booking process, we will get the booking details in pdf form. any idea how to implement the pdf in php form?
  25. I am new to coding and working on a website, I have data coming from my data base in this format to my product description area: Length=8 in|Width=0.180 in|Thickness=|Size Group=|Bundle Diam=1.9000 in [Max]|Material=Nylon|Color=Weather Resistant I need to somehow convert the data to this format in an HTML table in the same area: Length 8 in Width 0.180 in Thickness Size Group Bundle Diam 1.9000 in [Max] |Material=Nylon Color=Weather Resistant I know it seems friggin easy, but I am stumped! Any help will be appreciated!
×
×
  • 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.