Solved

PHP Question

Posted on 2014-04-23
6
505 Views
Last Modified: 2014-04-24
I have a page, with two buttons. One works fine but the second one does not.
The two buttons
                        
<div class="add_new align_center">
					<a href="#" class="js-item_add"><span class="glyphicon glyphicon-plus"></span> add new item</a>
					<a href="#" class="js-item_cp"><span class="glyphicon glyphicon-new"></span> clone an item</a>
				</div>

Open in new window


are in the page code below. Can anyone tell me how the first button is working...

Thanks

<?php

	include('helpers.php');

?>
<!DOCTYPE html>
<html lang="en-us">
<head>
	<meta charset="utf-8" />
	<meta name="robots" content="index, follow" />
	<meta name="description" content="" />
	<meta name="keywords" content="" />
	<meta name="viewport" content="width=device-width, initial-scale=1" /> 

	<title>Best Value Vacs Template Generator</title>
	
	<link rel="stylesheet" href="/bootstrap.css">
	<link rel="stylesheet" href="/js/jquery-ui/jquery-ui-1.10.4.custom.min.css">
	<link rel="stylesheet" href="/style.css">

</head>

<body>

	<div class="container-fluid">
		<div class="row">
	
			<div class="col-sm-4 col-md-3 sidebar">
	
				<h3>Items</h3>
	
				<ul class="list-group js-items">
					<?php
						
						//loop through the items folder, looking for .json files
						$dir = opendir('_items');
						while( ($filename = readdir($dir)) != false ) {
							if( strpos($filename, '.json') ) {
								$path = '_items/' . $filename;
								$file = fopen($path, 'r');
								$data = json_decode(fread($file, filesize($path)));
								fclose($file);
						
					?>
						<li class="list-group-item" data-id="<?php echo $data->item->item_id ?>">
							<a href="#" class="js-item_load"><?php echo $data->item->item_title; ?></a>
							<a href="#" class="noshow delete js-item_delete"><span class="glyphicon glyphicon-remove"></span></a>
						</li>
						
					<?php
							}
						}
						
					?>
					
				</ul>
				
				<div class="add_new align_center">
					<a href="#" class="js-item_add"><span class="glyphicon glyphicon-plus"></span> add new item</a>
					<a href="#" class="js-item_cp"><span class="glyphicon glyphicon-new"></span> clone an item</a>
				</div>
	
			</div>

Open in new window

0
Comment
Question by:JefferyBraun
6 Comments
 
LVL 34

Accepted Solution

by:
Dan Craciun earned 250 total points
ID: 40018415
I don't see what php has to do with this question.

Those links are probably submitted via JS, and that code is missing from your listing.
0
 
LVL 31

Assisted Solution

by:Marco Gasi
Marco Gasi earned 250 total points
ID: 40018446
Yes, I agree with Dan, but I don't see any link to javascript code except the jquery-ui: you should have a link to jquery also, before that link. In addition you should have a script which manages the buttons and in the posted code there is nothing. We're missing something, here...
0
 

Author Closing Comment

by:JefferyBraun
ID: 40018490
Thank you.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 34

Expert Comment

by:Dan Craciun
ID: 40018496
You're welcome, but I don't see how I helped?
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 40018501
@JefferyBraun: You posted the question at 3:08pm and closed it at 3:48pm.  If you had left it open a little longer (24 hours is a reasonable minimum) a Topic Advisor would have been able to remove the PHP Zone and replace it with the appropriate Zones.  Since it is already closed you might want to consider reposting the question in the HTML CSS, JavaScript and jQuery Zones (or some combination of those).

best regards, ~Ray
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 40018502
Me too. We have just pointed to some missing info.
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
html input 8 42
SSRS 2016 Rendering HTML tables 3 25
Character counter breaks after adding EmojiOne Area 4 19
Html input text color the frame line 2 19
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question