Search the Community
Showing results for tags 'multiple'.
-
Hi Everyone. I need help. I need to find or make a software/page with the table which would allow multiple users to edit and put in values simultaneously. So, how i see it is that there is a table in front of several people, with certain data, e.g. different car names, and when one person puts a tick, as in to say, yes i want tht car (others will know the meaning), all the other users using the software or being on the page would instantaneously see that there is a tick next to this car for example, and beside the tick there would be an initial or a full name of the person who put the tick which would be filled in the cell automatically and all the users would be able to see it in realtime. Also an undo feature is good to have, in case a tick is put next to the wrong cell (e.g. car). I have tried using the Microsoft Excel to be shared by several users, however it proved itself to be inefficient as it cannot update realtime, the user has to save the document... Several of these tables might be needed, however, it would be handy if one person would create some similar table, they would be able to share it with other people for them all to use it simultaneously. Also if different people could have different colors assigned to them Something along the lines of: Please Help. I have very little knowledge in programming and php, have had some experience with html - if this helps at all...
- 3 replies
-
- programming
- server
-
(and 3 more)
Tagged with:
-
Hi everyone. I am new to PHP and i am trying to upload multiple images using a form. I need to send those images to the admin of the site via mail. Can anyone help me and show me a little demo? Here is the code of form for start <form enctype="multipart/form-data" id='cartform' name='cartform' method='POST' action='<?php echo home_url('/submit-order');?>'> <div> <input name="userimage[]" type="file" multiple accept="image/*"> <input type='submit' name='submit1' value='Proceed'> </div> </form> I need want to get the images on next page and use them as attachment with mail to admin. I am using Wordpress
-
I have 6 timers all running of a php page ranging from 15seconds to 6minutes. However you need to refresh the page to watch it countdown. I would like to set these up to do it so they all run down without having to keep leaving the page bur it showing up a message when the timer runs out.
-
hi there, i have the following query, which is supposed to return the valid sales lead counts and average the costs and count the leads during the past 30 days. SELECT SC.text_ServiceDescription, R.text_RegionDescription, GROUP_CONCAT(DISTINCT S.text_SupplierName SEPARATOR ', ') AS text_SupplierNames, IFNULL(SW.smallint_SuppliersWanted,0) AS bigint_SuppliersWantedAmount, COUNT(DISTINCT S.bigint_SupplierID) AS bigint_PremiumCustomersCount, ROUND(AVG(T.bigint_TransactionAmount),2) AS bigint_AvgCostPerLead, ROUND(COUNT(DISTINCT LS.bigint_LeadID, LS.smallint_LeadOrdinal),2) AS bigint_AvgNumLeadsGen FROM 4_servicesuppliers SS LEFT JOIN 2_servicescatalogue SC ON (SS.bigint_ServiceID = SC.bigint_ServiceID) LEFT JOIN 1_regions R ON (SS.bigint_RegionID = R.bigint_RegionID OR SS.bigint_RegionID = R.bigint_ParentRegionID) LEFT JOIN 5_suppliers S ON (SS.bigint_SupplierID = S.bigint_SupplierID) LEFT JOIN 11_supplierswanted SW ON (SS.bigint_ServiceID = SW.bigint_ServiceID AND R.bigint_RegionID = SW.bigint_RegionID) LEFT JOIN 3_serviceattributes SA0 ON (SC.bigint_PrimaryAttributeKey = SA0.bigint_AttributeID AND SC.bigint_ServiceID = SA0.bigint_AttributeServiceID) LEFT JOIN 3_serviceattributes SA1 ON (SA0.text_AttributeDescription = SA1.text_AttributeDescription AND SC.bigint_ServiceID = SA1.bigint_AttributeServiceID) LEFT JOIN 25_serviceleads SL ON (SC.bigint_ServiceID = SL.bigint_ServiceID AND SL.text_LeadAttributes LIKE CONCAT("%",SA1.text_AttributeDescription," = ",SA1.text_AttributeValue,"%")) LEFT JOIN 27_leadssent LS ON (SL.bigint_LeadID = LS.bigint_LeadID) LEFT JOIN 8_transactions T ON (SL.bigint_LeadID = T.bigint_LeadID AND LS.smallint_LeadOrdinal = T.smallint_LeadOrdinal) WHERE S.smallint_SupplierStatus = 0 AND IFNULL(SW.smallint_SuppliersWanted,0) > 0 AND SL.timestamp_LeadCreated >= DATE_SUB(CURDATE(),INTERVAL 30 DAY) AND SL.text_LeadAttributes LIKE CONCAT("%",SA1.text_AttributeDescription," = ",SA1.text_AttributeValue,"%") AND LS.text_Duplicates = "" GROUP BY SS.bigint_ServiceID, SW.bigint_RegionID ORDER BY SS.bigint_ServiceID ASC, R.bigint_RegionID ASC; however - this query takes forever to execute, even longer than the system timeout in phpmyadmin! also via php... in php i have a microtimer attached which times the query above, at 1568.6739211082 seconds. how can i optimize the query above, especially with regard to the 25_serviceleads, 27_leadssent and 8_transactions JOIN's? i have uploaded the sql digest for the tables above to this message, to recreate this issue (removing the email addresses of course - as we do not condone spam ) to: http://performatix.co/Untapped_Potential_Income.zip please respond if you authentically know your mysql (especially the joins!) - you are welcome to assist. i have not been able to do the course myself yet - what i do know - is all as result of a lifelong hobby. sincerely, Pierre "Greywacke" du Toit.
-
i am using sessions. first on admin folder and second on user folder. in admin folder, i use $_SESSION['username']; in user folder, i use $_SESSION['username1']; now when i click on logout button in localhost/xxx/admin/logout.php i also logged out from localhost/xxx/logout.php. is there a way.. not to be logged out from user panel when click logout button in admin panel????
-
Hi all, I am new here and have a question. I have created a search tool for a database table which I am currently searching through the Description column in the table but would like to add the Title, and the Category columns as well. My script is below. it searches, creates the table adn displays adn paginates perfectly, but as soon as I try to add more variables it crashes. It seems to be in the $construct variable I am building to fetch adn display the results. Any assistance would be great. I would like to be able to, in index.php search feild, put Burger and it would look through Title, Catagory, adn Description within the table and display the results. This is the Index.php script <html> <head> <title>RECIPE SEARCH</title> </head> <body> <form action='search.php' method='GET'> <center> <h1>CHEF JAMIE RECIPE SEARCH TOOL</h1><br/> <h4>Currently searching through recipe ingredients.</h4> <input type='text' size='50' name='search'></br></br> <input type='submit' name='submit' value='Search source code' ></br></br></br> </center> </form> </body> </html> And this is the search.php page <?php $button = $_GET ['submit']; $search = $_GET ['search']; if(strlen($search)<=1) echo "Search term too short"; else{ echo "You searched for <b>$search</b> <hr size='1'></br>"; mysql_connect("localhost","xxxx","xxxxxx!"); mysql_select_db("chefjami_CJG2"); $search_exploded = explode (" ", $search); foreach($search_exploded as $search_each) { $x++; if($x==1) $construct .="Description LIKE '%$search_each%'"; else $construct .="AND Description LIKE '%$search_each%'"; } $constructs ="SELECT * FROM recipes WHERE $construct"; $run = mysql_query($constructs); $foundnum = mysql_num_rows($run); if ($foundnum==0) echo "Sorry, there are no matching result for <b>$search</b>.</br></br>1. Try more general words. for example: If you want to search 'how to create a website' then use general keyword like 'create' 'website'</br>2. Try different words with similar meaning</br>3. Please check your spelling. </br>4. <a href='index.php'>Go back to search</a>"; else { echo "$foundnum results found ! <a href='index.php'>Go back to search</a><p>"; $per_page = 1; $start = $_GET['start']; $max_pages = ceil($foundnum / $per_page); if(!$start) $start=0; $getquery = mysql_query("SELECT * FROM recipes WHERE $construct LIMIT $start, $per_page"); while($runrows = mysql_fetch_assoc($getquery)) { $Title = $runrows ['Title']; $Description = $runrows['Description']; $Catagory = $runrows ['Catagory']; echo " <b><h3>$Title</h3></b><br> $Description<br> <strong>Category: $Catagory</strong><p> <hr> "; } //Pagination Starts echo "<center>"; $prev = $start - $per_page; $next = $start + $per_page; $adjacents = 3; $last = $max_pages - 1; if($max_pages > 1) { //previous button if (!($start<=0)) echo " <a href='search.php?search=$search&submit=Search+source+code&start=$prev'>Prev</a> "; //pages if ($max_pages < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up { $i = 0; for ($counter = 1; $counter <= $max_pages; $counter++) { if ($i == $start){ echo " <a href='search.php?search=$search&submit=Search+source+code&start=$i'><b>$counter</b></a> "; } else { echo " <a href='search.php?search=$search&submit=Search+source+code&start=$i'>$counter</a> "; } $i = $i + $per_page; } } elseif($max_pages > 5 + ($adjacents * 2)) //enough pages to hide some { //close to beginning; only hide later pages if(($start/$per_page) < 1 + ($adjacents * 2)) { $i = 0; for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { if ($i == $start){ echo " <a href='search.php?search=$search&submit=Search+source+code&start=$i'><b>$counter</b></a> "; } else { echo " <a href='search.php?search=$search&submit=Search+source+code&start=$i'>$counter</a> "; } $i = $i + $per_page; } } //in middle; hide some front and some back elseif($max_pages - ($adjacents * 2) > ($start / $per_page) && ($start / $per_page) > ($adjacents * 2)) { echo " <a href='search.php?search=$search&submit=Search+source+code&start=0'>1</a> "; echo " <a href='search.php?search=$search&submit=Search+source+code&start=$per_page'>2</a> .... "; $i = $start; for ($counter = ($start/$per_page)+1; $counter < ($start / $per_page) + $adjacents + 2; $counter++) { if ($i == $start){ echo " <a href='search.php?search=$search&submit=Search+source+code&start=$i'><b>$counter</b></a> "; } else { echo " <a href='search.php?search=$search&submit=Search+source+code&start=$i'>$counter</a> "; } $i = $i + $per_page; } } //close to end; only hide early pages else { echo " <a href='search.php?search=$search&submit=Search+source+code&start=0'>1</a> "; echo " <a href='search.php?search=$search&submit=Search+source+code&start=$per_page'>2</a> .... "; $i = $start; for ($counter = ($start / $per_page) + 1; $counter <= $max_pages; $counter++) { if ($i == $start){ echo " <a href='search.php?search=$search&submit=Search+source+code&start=$i'><b>$counter</b></a> "; } else { echo " <a href='search.php?search=$search&submit=Search+source+code&start=$i'>$counter</a> "; } $i = $i + $per_page; } } } //next button if (!($start >=$foundnum-$per_page)) echo " <a href='search.php?search=$search&submit=Search+source+code&start=$next'>Next</a> "; } echo "</center>"; } } ?>
-
Ok I have some code that's really starting to bug me... The form right under posts to a page and php picks it up and processes it. My problem is that the php will pick up the data and process it if the fields are not filled in or if only one but not both file input are selected. I want to be able to upload both at the same time.The other $POST variable post just fine but not when both $FILES are selected. P.s. I cleaned up the code a bit so its easier to read its not exactly how it is on my site please help! <form action="/administration/xxupload/" method="post" enctype="multipart/form-data"> <input type="hidden" name="artist_id" value="<?php echo $id; ?>" /> </span><input type="text" name="title" id="title" /> <span>Artwork:</span><input type="file" name="art" id="artwork"/> <span>Song:</span><input type="file" name="content" id="content"/> ><span>Details:</span><br/><textarea id="detail" name="detail" ></textarea> <input type="hidden" name="type" value="1" /> <input type="hidden" name="user" value="Admin" /> <input type="hidden" name="time" value="<?php echo time() ?>" /> <div id="tagsdiv">Tags:<input type="text" name="tags" /></div> <div id="submit"><input type="submit" name="upload_single"/></div> </form> Part of xxupload.php if (isset($_POST['upload_single'])){ $artist_id=$_POST['artist_id']; $artist_display=mysql_fetch_assoc(mysql_query("SELECT name FROM artists WHERE id=".$artist_id)); $artist_name=$artist_display['name']; $title=$_POST['title']; $tmp_art_name=$_FILES['art']['tmp_name']; $old_art_name=$_FILES['art']['name']; $dest_art="../media/singles/artwork/".$old_art_name; move_uploaded_file($tmp_art_name,$dest_art); $realart="../media/singles/artwork/".$artist_name."-".$title.".jpg"; $art="/media/singles/artwork/".$artist_name."-".$title.".jpg"; rename($dest_art,$realart); $tmp_content_name=$_FILES['content']['tmp_name']; $old_content_name=$_FILES['content']['name']; $dest_content="../media/singles/".$old_content_name; move_uploaded_file($tmp_content_name,$dest_content); $realcontent="../media/singles/".$artist_name."-".$title.".mp3"; $content="/media/singles/".$artist_name."-".$title.".mp3"; rename($dest_content,$realcontent); $detail=$_POST['detail']; $tags=$_POST['tags']; $type=$_POST['type']; $user=$_POST['user']; $tic=$_POST['time']; mysql_query ("INSERT INTO media(artist_id,title, art, content, detail,tags,user,type,tic) VALUES ('$artist_id','$title','$art','$content','$detail','$tags','$user','$type','$tic')"); header( 'Location: /administration/' ) ; } elseif
-
Hey guys, I was just woundering what would be the best way of writing multiple popup functions? I can copy the code few times and change the ID but that doesen't sound efficeint. <script type="text/javascript"> var popUpActive = false; $(document).ready(function(){ //open popup $("#pop").click(function(){ if(popUpActive == false){ $("#flyout").fadeIn(150, function(){ popUpActive = true; }); } }); $(document).click(function(){ if(popUpActive == true) $("#flyout").fadeOut(150, function(){ popUpActive = false; }); }); }); </script>
-
I have a set rental amount with some variable making an equation. The final variable is the TOTAL of all the equations, i need the total of this variable <?php //option 1 52 weeks $weeklyToStudent = $row_rsTenProp['rental_price']; $fourWeeksSecurityDep = 4 * $weeklyToStudent; $fivetwoWeeksPayable = $weeklyToStudent * 52; $fee = 184.80; $resFee = 250; $fivetwoPayIncFeedSecDep = $fourWeeksSecurityDep + $fivetwoWeeksPayable + $fee; $initPay15Wks = $weeklyToStudent*15; $initPay15WksFeeSecDep = $initPay15Wks + $fee + $fourWeeksSecurityDep; $balanceB4MovingIn = $initPay15WksFeeSecDep - $resFee; $second14Wks = $weeklyToStudent * 14; $third14Wks = $weeklyToStudent * 14; $fourth9Wks = $weeklyToStudent * 9; $totalPayment = $initPay15WksFeeSecDep + $second14Wks + $third14Wks + $fourth9Wks; ?> <?php do { ?> <tr> <td class="table-text"><a href="customer-info.php?recordID=<?php echo $row_rsTenProp['userid']; ?>"><?php echo $row_rsTenProp['userid']; ?></a></td> <td class="table-text"><?php echo $row_rsTenProp['weeks'] / 7; ?> weeks</td> <td class="table-text"><?php echo $row_rsTenProp['payment_option']; ?></td> <td class="table-text"><?php echo $row_rsTenProp['rental_price']; ?></td> <td class="table-text"><?php echo $row_rsTenProp['prop_id']; ?></td> <td class="table-text"><?php echo DoFormatCurrency($totalPayment, 2, ',', '.', '£ '); ?></td> <td> </td> <td> </td> </tr> <?php } while ($row_rsTenProp = mysql_fetch_assoc($rsTenProp)); ?> i need to multiple the $totalPayment to get the TOTAL of this variable <?php $totalPaymentTot = 0; while ($totalPayment = ($row_totalPayment)); $totalPaymentTot += $row_totalPayment;{ $row_totalPayment; } echo $totalPaymentTot;?>
-
SELECT from multiple tables, from columns the same name
ScrewLooseSalad posted a topic in MySQL Help
I have 8 Tables, each contain the same 8 columns, I want to select all of these tables that have a value not equal to zero from one of these columns; the queries I've been able to jumble together from SQL I've found online output each of the tables three times; can anyone help me find the SQL query I need? Thanks. Amongst other things I've tried: SELECT tableC.column6, tableF.column6 FROM tableC, tableF WHERE tableC.column6!=0 OR tableF.column6!=0 -
My website involves loading several other pages at a time to produce results from all of them. The problem I had was loading times with some websites taking upto 10 seconds, where as others would take less than 1 second. I ended up setting the timeout feature in the PHP.ini file to 1 second, which is fine not to include results from slow loading pages. But I would like to be able to load all 10 web pages using "file_get_contents" simultaniously since the connection on my server is a good 100Mb. Is this possible? Thanks
- 4 replies
-
- file_get_contents
- multiple
-
(and 1 more)
Tagged with:
-
I apologize in advance for my utter noobness. I've been learning php in bits and pieces. My database structure: 3 fields only, the relevant ones being "artist" and "title" I made a search page (POETS Karaoke songs) that searches correctly, but only if the user inputs partial or complete words in the correct order, and the words only appear in one of the two fields. I wanted to make it possible to find artist/title combination when multiple or partial words are input in any order. I did something wrong, in that my new coding returns the database regardless of the search terms. This broken page is here. <form name="search" method="post" action="<?=$PHP_SELF?>"> <span> <input type="text" name="find" /> <input type="hidden" name="searching" value="yes" /> <input type="submit" name="search" value="Search" /> </span> </form> <? //This is only displayed if they have submitted the form if ($searching =="yes") { echo "<br><b>You searched for: " .$find; echo "<hr>"; //If they did not enter a search term we give them an error if ($find == "") { echo "<p>No search term entered. Please go back to the previous page and try again."; exit; } // Begin Search $searchQuery = ''; // search query is empty by default $searchCondition = "(artist LIKE '%%' OR title LIKE '%%')"; $searchFieldName = 'artist'; // name of the field to be searched $searchFieldName2 = 'title'; if(isset($find['text'])) { // check if a query was submitted $searchQuery = trim($find['text']); // getting rid of unnecessary white space $searchTerms = explode(" ", $searchQuery); // Split the words $searchCondition = "($searchFieldName LIKE '%" . implode("%' OR $searchFieldName LIKE '%", $searchTerms) . "%')"; // Forming the condition for the sql $searchCondition .= " OR ($searchFieldName2 LIKE '%" . implode("%' OR $searchFieldName2 LIKE '%", $searchTerms) . "%')"; } // End Search $sql = "SELECT * FROM songs WHERE $searchCondition;"; // the rest is just database connection and retrieving the results $dblink = mysql_connect("poetskaraokecom.ipagemysql.com", "poets", "guest"); mysql_select_db("poets_songs", $dblink); $result = mysql_query($sql, $dblink); echo "<ol>"; // Capture the result in an array, and loop through the array while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { printf("<li>%s<font color='grey'> ... </font><i>%s</i></li>", $row[artist], $row[title]); } echo "</ol>"; //This counts the number or results - and if there wasn't any it gives them a little message explaining that $anymatches=mysql_num_rows($result); if ($anymatches == 0) { echo "No entries matched your query<br><br>"; } } ?> I haven't been able to determine whether my error is in my query of the database, or if it's in the return of the results. Any help would be much appreciated. Thanks, Cindy
-
Hiya i'm working on a project, which involves a list of checkboxes which are automaticly populated by the database which is currently working at while ($row = mysql_fetch_array($sql)) { $id = $row['id']; $hotbox = $row['hot_job']; ?> <form name='hotbox' action='hot_update.php' method='POST'> <tr><td><strong><?php echo $id; ?></strong></td> <td><input name="ONOFF<? echo $row['id']; ?>" type="checkbox" id="ONOFF" value="1" <?php if ($row['hot_job'] == 'YES') { echo "checked";} else {} ?> </td></tr> <?php } ?> however when the user has unchecked/checked the correct boxes and clickes update, nothing changes. Here is my current code foreach($_POST['id'] as $id) { $onoff = 0; if (isset($_POST["ONOFF".$id])) { $onoff = 1; } if($onoff == 1) { $sql1="UPDATE jobs SET hot_job='".$onoff."' WHERE id='".$id."'"; } else { $sql1="UPDATE jobs SET hot_job='".$onoff."' WHERE id='".$id."'"; } echo $id; echo $onoff; $result1=mysql_query($sql1); } ?> The mysql setup is id hot_job 1 YES 2 YES 3 NO 4 YES ect Any help would be greatly appreciated
-
I'm trying to merge all these queries into one statement $q = "DELETE FROM ".TBL_USERS." WHERE username = '$session->username'"; $database->query($q); $q = "DELETE FROM ".TBL_BANNED_USERS." WHERE username = '$session->username'"; $database->query($q); $q = "DELETE FROM ".TBL_MAIL." WHERE UserTo = '$session->username'"; $database->query($q); $q = "DELETE FROM ".TBL_MAIL." WHERE UserFrom = '$session->username'"; $database->query($q); $q = "DELETE FROM ".TBL_FRIENDS." WHERE person_id = '$session->username'"; $database->query($q); $q = "DELETE FROM ".TBL_FRIENDS." WHERE friend_id = '$session->username'"; $database->query($q); $q = "DELETE FROM ".TBL_FORUM." WHERE author = '$session->username'"; $database->query($q); I have no idea how to do this I have tried Google and no joy please help - Jamie
-
Hello PHPFreaks Been a long time since i've been here last time! (hopefully it means that i'm getting better However! I'm playing around with "new" technology the mod_rewrite for the .htaccess file. I'm writting a php app where the url has 2 parameters. example.com?path=this/is/a/path/to/this/&slug=page NOW my dilemma is that my .htaccess rules work IF there is NO / (slash) in the ?path= var (since I separate the 2 vars at a /). my question is now! (bear in mind here that i'm a ROOKIE at .htaccess rewriting) how do i go about in the .htaccess file to make it reconize that whatever comes after the last slash the $2 variable and everything is $1 - even if there is no $path defined in the url? BTW! I'm not looking for free handouts and do my coding here! I'm willing to learn here but just need pointers!! I've pasted my .htaccess file here: Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_URI} !=/index.php RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/([^/.]+)$ /index.php?slug=$1&type=$2&view=$3&action=$4 [L,PT] RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)$ /index.php?slug=$1&type=$2&view=$3 [L,PT] RewriteRule ^([^/.]+)/([^/.]+)$ /index.php?path=$1&slug=$2 [L,PT] RewriteRule ^([^/.]+)$ /index.php?slug=$1 [L,PT] RewriteRule ^(.+)/$ /$1 [R=301,L] Thanks in advance
-
So basically want to have a search box and I want users to type in a name and then hit search. It then needs to search through multiple JSON files(11,480) to be precise. I want it to find the name inside the JSON and then pull other information from that JSON file. ATM I only have it where you put in the json file and then it reads the data. The code I currently have is; <?php $string = file_get_contents("2.json"); $json_a=json_decode($string,true); echo "First Name: ", $json_a['Item'][FirstName]; echo "<br>Surname: ", $json_a['Item'][LastName]; echo "<Br>Height: ", $json_a['Item'][Height], "cm"; echo "<br>Rating: ", $json_a['Item'][Rating], " OVRL"; echo "<br>Pace: ", $json_a['Item'][Attribute1]; echo "<br>Shooting: ", $json_a['Item'][Attribute2]; echo "<br>Passing: ", $json_a['Item'][Attribute3]; echo "<br>Dribbling: ", $json_a['Item'][Attribute4]; echo "<br>Defending: ", $json_a['Item'][Attribute5]; echo "<br>Heading: ", $json_a['Item'][Attribute6]; ?> Thanks