Jump to content

abrahamgarcia27

Members
  • Posts

    131
  • Joined

  • Last visited

Everything posted by abrahamgarcia27

  1. i just looked at it my main html source doesn't show the videos, probably because they are running through AJAX it shows this <div id="searchResults"> <div id="searchResultsListColumn"> <div id="searchResultsVideoList"> </div> </div> <div id="searchResultsVideoColumn"> <div id="videoPlayer"></div> </div> </div> but when i inspect the elements it does show this <img src="http://i.ytimg.com/vi/YY7LOQK6giw/0.jpg" height="150px" width="150px" title="Natalie Calvert, Calcom Group: Experimentation" class="imgOpa">
  2. i have this function that is running a jquery class running in the image, but i can't make the effect run. <td width="130" ><img src="${thumbnailUrl}" height="150px" width="150px" title="${videoTitle}" class="imgOpa" /> i placed another image like this and this work so i dont know if there is a problem running a class inside a function. <img src="images/01.png" class="imgOpa" /> /** * Echo the list of videos in the specified feed. * * @param Zend_Gdata_YouTube_VideoFeed $feed The video feed * @return void */ function echoVideoList($feed) { echo "<h2 style='text-align:left;font-family:Tahoma, Geneva, sans-serif; color:#999;'>Search Results</h2>"; echo '<table class="videoList">'; echo '<tbody width="100%">'; $i = 1; foreach ($feed as $entry) { $videoId = $entry->getVideoId(); $thumbnailUrl = $entry->mediaGroup->thumbnail[0]->url; $videoTitle = $entry->mediaGroup->title; $videoDescription = $entry->mediaGroup->description; print <<<END <tr onclick="ytvbp.presentVideo('${videoId}')"> <td width="130" ><img src="${thumbnailUrl}" height="150px" width="150px" title="${videoTitle}" class="imgOpa" /> </td> </tr> END; if( $i % 5 === 0 && $entry !== end($feed) ) { echo "</table>\n<table class='videoList2'>\n"; } elseif ( $entry === end($feed) ) { echo "</table>\n"; } $i++; } }
  3. well the script that i uploaded doesn't actually create the database it just refers to it you have to create the database yourself. Did you already do this my databse is composed of the following. CREATE TABLE IF NOT EXISTS `people` ( `id` int(10) NOT NULL AUTO_INCREMENT, `email` varchar(200) NOT NULL, `admin` int(1) NOT NULL, `fname` varchar(300) NOT NULL, `lname` varchar(300) NOT NULL, `suffix` varchar(50) NOT NULL, `userid` varchar(100) NOT NULL, `comment` varchar(500) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ; http://phedx.azsurveillance.net/scripts_trials/freaks/people.sql you can download it here
  4. have you created your mysql database already? maybe thats why it is not working 17249_.php
  5. this one works, but there is no validation so if you submit form without any values it still runs the query and inserts values and sends email. it is working i have it hosted here http://phedx.azsurveillance.net/scripts_trials/freaks/registerUser.php there is two html tags because the 2nd html is the main form after the form is submitted the form submit and goes to the following url http://phedx.azsurveillance.net/scripts_trials/freaks/registerUser.php?m=1 if you see the script it says if the message = 1 it will echo thank you you have succesfully registered if not it will echo the main form this is why it has two html tags
  6. this code will insert to a database as well as to send the email that there has been a new user registered <?php //connect to your database $connection = mysql_connect("localhost","root","pass"); if (!$connection) { die('Could not connect: ' . mysql_error()); } //message if query successful $message= $_GET['m']; if ($message == "1"){ //insert infomation to database mysql_select_db("databse", $connection); $sql="INSERT INTO people (fname, lname, suffix, userid, email, comment, admin) VALUES ('$_POST[fname]','$_POST[lname]','$_POST[suffix]', '$_POST[userid]', '$_POST[email]' , '$_POST[comment]', '0')"; if (!mysql_query($sql,$connection)) { die('Error: ' . mysql_error()); } //select query and choose database $result = mysql_query("SELECT * FROM people WHERE admin=1"); while($row = mysql_fetch_array($result)) { $to = $row['email']; } //post variables $fname = $_POST['fname']; $lname = $_POST['lname']; $suffix = $_POST['suffix']; $userid = $_POST['userid']; $email = $_POST['email']; $comment= $_POST['comment']; //send the emails $subject = "Request for new WishList account"; $message = "The following person is requesting a new account<p><b>First Name:</b> " . $fname . "<br><b>Last Name:</b> " . $lname ."<br><b>Suffix:</b> " . $suffix . "<br><b>Desired Userid:</b> " . $userid . "<br><b>Email:</b> " . $email . "<br><b>Comment</b><br>" .$comment;$headers = "From: webmaster@example.com" . "\r\n" . "CC: somebodyelse@example.com"; mail($to,$subject,$message,$headers); //echo content echo "<HTML> <link rel=stylesheet href=style.css type=text/css> <title>Sign Up </title> <BODY> <table cellspacing='0' cellpadding='5' width='100%' height='100%' bgcolor='#FFFFFF' nosave border='0' style='border: 1px solid rgb(128,255,128)'> <tr> <td valign='top'> <center><h2>Thank you. You should receive an email shortly with your account details</h2> </center> </td> </tr> </table> </body> </html>" ; }else { //main form echo "<HTML> <link rel=stylesheet href=style.css type=text/css> <title>Sign Up </title> <BODY> <table cellspacing='0' cellpadding='5' width='100%' height='100%' bgcolor='#FFFFFF' nosave border='0' style='border: 1px solid rgb(128,255,128)'> <tr> <td valign='top'> <center> The following information will be submitted to the administrator of the WishList Site who will create an account for you. You will receive an email with your WishList password when the account is created. <p> <form method=post action='registerUser.php?m=1'> <table style='border-collapse: collapse;' id='AutoNumber1' border='0' bordercolor='#111111' cellpadding='2' cellspacing='0' bgcolor=lightYellow> <tr><td colspan='2' align='center' bgcolor='#6702cc'> <font size=3 color=white><b>Please Fill In</b></font> </td></tr> <tr> <td align=right><b>First Name</b></td> <td><input type=text name=fname size=20></td> </tr> <tr> <td align=right><b>Last Name</b></td> <td><input type=text name=lname size=20></td> </tr> <tr> <td align=right><b>Suffix</b></td> <td><input type=text name=suffix size=20></td> </tr> <tr> <td align=right><b>Desired Userid</b></td> <td><input type=text name=userid size=20></td> </tr> <tr> <td align=right><b>Email</b></td> <td><input type=text name=email size=40></td> </tr> <tr> <td align=right><b>Comment</b></td> <td><textarea name=comment rows=3 cols=60></textarea></td> </tr> <tr><td align='center' colspan='2' bgcolor='#c0c0c0'> <input type='submit' value='Submit' style='font-weight:bold'> </td></tr> </table> </form> </center> </td> </tr> </table> </body> </html>"; } ?>
  7. do you want to store the people that register to your site in a database?
  8. yeah you are going to have to clean that code up because there is alot of syntax error on the html form
  9. this is what i would do my code may not be the best, but it works. There is still alot of styling to be done. Hope it helps! <?php //connect to your database $connection = mysql_connect("localhost","user","password"); if (!$connection) { die('Could not connect: ' . mysql_error()); } //message if query successful $message= $_GET['m']; if ($message == "1"){ //select query and choose database mysql_select_db("database", $connection); $result = mysql_query("SELECT * FROM people WHERE admin=1"); while($row = mysql_fetch_array($result)) { $to = $row['email'].","; //post variables $fname = $_POST['fname']; $lname = $_POST['lname']; $suffix = $_POST['suffix']; $userid = $_POST['userid']; $email = $_POST['email']; $comment= $_POST['comment']; //send the emails $subject = "Request for new WishList account"; $message = "The following person is requesting a new account<p><b>First Name:</b> " . $fname . "<br><b>Last Name:</b> " . $lname ."<br><b>Suffix:</b> " . $suffix . "<br><b>Desired Userid:</b> " . $userid . "<br><b>Email:</b> " . $email . "<br><b>Comment</b><br>" .$comment;$headers = "From: webmaster@example.com" . "\r\n" . "CC: somebodyelse@example.com"; mail($to,$subject,$message,$headers); } //echo content echo "<h2>Thank you. You should receive an email shortly with your account details</h2>" ; }else { //main form echo '<HTML> <link rel=stylesheet href=style.css type=text/css> <title>Sign Up </title> <BODY> <table cellspacing="0" cellpadding="5" width="100%" height="100%" bgcolor="#FFFFFF" nosave border="0" style="border: 1px solid rgb(128,255,128)"> <tr> <td valign="top"> "<center>" The following information will be submitted to the administrator of the WishList Site who will create an account for you. You will receive an email with your WishList password when the account is created. </td></tr></table> <p> <form method=post action="registerUser.php?m=1"> <table style="border-collapse: collapse;" id="AutoNumber1" border="0" bordercolor="#111111" cellpadding="2" cellspacing="0" bgcolor=lightYellow> <tr><td colspan="2" align="center" bgcolor="#6702cc"> <font size=3 color=white><b>Please Fill In</b></font> </td></tr> <tr> <td align=right><b>First Name</b></td> <td><input type=text name=fname size=20></td> </tr> <tr> <td align=right><b>Last Name</b></td> <td><input type=text name=lname size=20></td> </tr> <tr> <td align=right><b>Suffix</b></td> <td><input type=text name=suffix size=20></td> </tr> <tr> <td align=right><b>Desired Userid</b></td> <td><input type=text name=userid size=20></td> </tr> <tr> <td align=right><b>Email</b></td> <td><input type=text name=email size=40></td> </tr> <tr> <td align=right><b>Comment</b></td> <td><textarea name=comment rows=3 cols=60></textarea></td> </tr> <tr><td align="center" colspan="2" bgcolor="#c0c0c0"> <input type="submit" value="Submit" style="font-weight:bold"> </td></tr> </table> </form> "</center>" </td> </tr> </table> </body> </html>'; } ?>
  10. try this phpsense onpagination class http://phpsense.com/2007/php-pagination-script/ or this forum has a basic pagination script tutorial http://www.phpfreaks.com/tutorial/basic-pagination
  11. sorry how would i do this i am really new to php i found this example i tried applying, but i dont think i am going the right track <html> <body> <?php $array = array( 1, 2, 3, 4, 5); foreach( $array as $value ) { if( $value == 3 )continue; echo "Value is $value <br />"; } ?> </body> </html>
  12. i am using a zend framework youtube so the data is coming from the youtube function echoVideoList($feed) { echo "<h2 style='text-align:left;font-family:Tahoma, Geneva, sans-serif; color:#999;'>Search Results</h2>"; echo '<table class="videoList">'; echo '<tbody width="100%">'; foreach ($feed as $entry) { $videoId = $entry->getVideoId(); $thumbnailUrl = $entry->mediaGroup->thumbnail[0]->url; $videoTitle = $entry->mediaGroup->title; $videoDescription = $entry->mediaGroup->description; print <<<END <tr onclick="ytvbp.presentVideo('${videoId}')"> <td width="130"><img src="${thumbnailUrl}" height="100px" width="100px" /> <br /> <a href="#">${videoTitle}</a> </td> </tr> END; } echo '</table>'; }
  13. well i dont want to limit to 5 entries i want to echo 10 entries but after the 5 entry it goes to another table So preety much <table id=table 1> echo 'record1' echo 'record1' echo 'record1' echo 'record1' echo 'record1' </table <table id=table 2> echo 'record1' echo 'record1' echo 'record1' echo 'record1' echo 'record1' </table> so preety much after it echos the 5 entries it would go to the other table id
  14. i have a table that echos 10 entries what i want to do is once it echos 5 records it starts a new table. I dont know how to go about this. Could you guys guide me the right way.
  15. now i am trying to run a count of those, but since i am very bad at syntax i wanted to see if anyone knows what is going wrong here //Where clause and count $query2 = 'SELECT COUNT(*) FROM `sales` WHERE `tlunch` = 2 AND (`date` BETWEEN $from AND $to)'; $result2 = mysql_query($query2) or die('Sorry, we could not count the number of results: ' . mysql_error()); $paid = mysql_result($result2, 0);
  16. thank i got it with this code // using escape() and fetch_all_array() // pullout the first 10 entries where url came from google // using defined TABLE_USERS table name from config // $db->escape() escapes string to make it safe for mysql $sql = "SELECT student_id, sales_id, barcode_id, tlunch, date FROM `".TABLE_SALES."` WHERE date BETWEEN '$from' AND '$to'"; //`tlunch` = 1 AND DATE(date) = CURDATE( // feed it the sql directly. store all returned rows in an array $rows = $db->fetch_all_array($sql); ?>
  17. i got it working with this code but now i cant query from a date to another is there a TO function in SQL // pullout the first 10 entries where url came from google // using defined TABLE_USERS table name from config // $db->escape() escapes string to make it safe for mysql $sql = "SELECT student_id, sales_id, barcode_id, tlunch, date FROM `".TABLE_SALES."` WHERE date = '$to' AND '$from'"; //`tlunch` = 1 AND DATE(date) = CURDATE( // feed it the sql directly. store all returned rows in an array $rows = $db->fetch_all_array($sql); i tried using TO but i guess it doesnt exist
  18. i started something but i doesnt seem to be working <?php //Get required files require_once('auth.php'); include('header.php'); include('menu.php'); require("config.inc.php"); require("Database.class.php"); // create the $db object $db = new Database(DB_HOST, DB_USER, DB_PASS, DB_DATABASE); // connect to the server $db->connect(); //dates posted from report $todate = $_POST['todate']; $fromdate = $_POST['fromdate']; // using escape() and fetch_all_array() // pullout the first 10 entries where url came from google // using defined TABLE_USERS table name from config // $db->escape() escapes string to make it safe for mysql $sql = "SELECT barcode_id, student_id, tlunch, date FROM `".TABLE_SALES."` WHERE date = $fromdate AND $todate"; //`tlunch` = 1 AND DATE(date) = CURDATE( // feed it the sql directly. store all returned rows in an array $rows = $db->fetch_all_array($sql); ?> <div class="content"> <div class="widget first"> <div class="table"> <div class="head"><h5 class="iFrames">Students</h5></div> <table cellpadding="0" cellspacing="0" border="0" class="display" id="example"> <thead> <tr> <th>Student ID</th> <th>Barcode ID</th> <th>Type of Lunch</th> <th>Date</th> </tr> </thead> <tbody> <?php foreach($rows as $record){ ?> <tr class="gradeA even"> <td> <?php echo $record['student_id']; ?></td> <td><?php echo $record['barcode_id']; ?></td> <td><?php echo $record['tlunch']; ?></td> <td><?php echo $record['date']; ?></td> </tr> <?php }?> </tbody> </table> </div> </div> </div> <div class="fix"></div> </div> <?php //include the footer include('footer.php'); ?>
  19. Hello i am working on an application where i want to count from a selected date to another date and query all entries my database right now is composed of the following sales_id barcode_id student_id type of lunch date i have created the count per day, but now dont know how to go about to query the results and the count for the month. $query = 'SELECT COUNT(*) FROM `sales` WHERE `tlunch` = 1 AND DATE(date) = CURDATE()'; $result = mysql_query($query) or die('Sorry, we could not count the number of results: ' . mysql_error()); $free = mysql_result($result, 0); has any one done something similar
  20. I couldn't make it work sorry i am really new to jquery and i am having so much problems making the function work
  21. <div class="page_index"><a href="javascript:jQuery('.flipbook').flipbook.gotoItem(5);">9. And More...</a></div> I have this jquery flipbook script that i bought from code canyon, but it doesnt have a function that i want. What i want to do is insert a text box where i can input the item that i want to go to. In this example you see it goes to item too with a click. But what i want is to have something like this <form> <input type="text" /> <button type="submit" onclick="Go to the value inserted into the text box" /> </form>
  22. I have the echo statement set up for all files, but what i want to do is put an if statement for example if it contains .pdf or .docx dont echo out an image how would i do this? <?php $id = explode("/", $_GET['a']); $id = $id[2]; ?> <?php global $allow_client_uploads; ?> <div id="content"> <div class="wrapper content"> <h3 class="page-title"><?php echo $project['name']; ?></h3> <div id="client-controls"> <a href="<?php echo $this->redirect('messages/add/'.$id, true); ?>" class="new-message">Post Message to Admin</a> <?php if($allow_client_uploads): ?> <a href="<?php echo $this->redirect('documents/add/'.$id, true); ?>" class="new-file">Upload A Document</a> <?php endif; ?> <a href="<?php echo $this->redirect('clients/change_password', true); ?>" class="change-password">Change Password</a> </div> <!--<div class="project-progress">Progress <div class="progressbar"> <div id="test" class="progressbar-completed" style="width:<?php // echo $project['progress']; ?>%;"> <div> </div> </div> <div><?php // echo $project['progress']; ?>%</div> </div> </div> --> <ul class="project-phases"> <?php $n=0; global $document_upload_path;?> <?php foreach($project['phases'] as $phase): ?> <li class="clearfix"> <div class="large-bullet"><?php echo ++$n; ?> </div> <h1 class="phase-title"><?php echo $phase ?></h1> <?php if(@count($documents[$n])>0): ?> <ol class="documents"> <?php foreach($documents[$n] as $doc): ?> <li> <a href="<?php echo $this->redirect('documents/download/'.$doc['path'], true); ?>"> <?php echo $doc['description']; ?> <br /> </a> <?php //echo $doc['size']."K - "; ?> <span class="date"><?php // echo date("F j, Y, g:i a", $doc['created']); ?></span> <?php // echo (isset($doc['uploaded_by']))? ", by ".$doc['uploaded_by']:""; ?> <a href="/clientele/uploads/<?php echo $doc['path'];?>" class="lightbox"><?php echo '<img src="/clientele/uploads/'.$doc['path'].'" height="300" width="300">'; ?></a> </li> <?php endforeach;?> </ol> <?php else: ?> <?php endif; ?> </li> <?php endforeach;?> </ul> <div class="sidebar"> <?php if(is_array($messages)): ?> <div class="messagebar">Latest News</div><br /> <?php foreach($messages as $message): ?> <div class="message clearfix"> <p class="body"><?php echo $message['message']; ?></p> <span class="meta"> <?php // echo $message['posted_by']; ?></span> </div> <?php endforeach; ?> <?php endif; ?> </div> <div class="clear"></div> </div> </div>
  23. I am trying to update a tiny int i have the if statement which says when tiny int is 1 echo closed and when tiny int 0 echo open. The problem is i am trying to query the result in a drop down but the option of status Closed doesnt appear. <?php //connect to database $con=mysql_connect("localhost","root","") or die("couldn't connect to mysql"); //select database $db=mysql_select_db("ac_res",$con) or die("database not found"); //get ID to Edit $id = $_GET['id']; //Query Fields to edit $sql = 'SELECT * FROM `ac_reservation` WHERE `id` = "'.$id.'"'; $query = mysql_query($sql) or die("Couldn't execute query. ". mysql_error()); $results = mysql_fetch_array($query); $status = 'status'; //Query the waiter table $waiter=mysql_query("SELECT fname FROM waiter") or die("query error"); ?> <form id="edituser" name="edituser" method="post" action="editresexec.php"> <table width="300" border="0" align="center" cellpadding="2" cellspacing="0"> <tr> <th> </th> <td><input name="id" type="hidden" class="textfield" value= <?php echo $results[id]?> /> </td> </tr> <tr> <th>First Name </th> <td><input name="fl_name" id="keyboard2" type="text" class="textfield" value= <?php echo $results[fl_name]?> /> </td> </tr> <tr> <th>Number of People</th> <td><input name="n_people" id="keyboard3" type="text" class="textfield" value= <?php echo $results[n_people]?> /> </td> </tr> <tr> <th>Table Number</th> <td><input id="t_number"name="t_number" type="text" class="textfield" value= <?php echo $results[t_number]?> /></td> </tr> <tr> <th>Waiter</th> <td><?php echo "<select name=waiter>"; while($r=mysql_fetch_array($waiter)) { //echo waiter name echo "<option value='".$r['fname']."'>".$r['fname']."</option>"; } echo "</select>"; ?> </td> </tr> <tr> <th>Status</th> <td><?php //If statement if($rows['status'] == 1) { $status = "Close"; } else $status = "Open"; //Drop Down Menu For Status echo "<select>"; echo "<option value='".$status."'>".$status."</option>"; echo "</select>"; ?> </td> </tr> <tr> <td> </td> <td><input type="submit" name="Update" value="Update" /></td> </tr> </table> </form>
×
×
  • 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.