Solved

PHP Question

Posted on 2014-04-23
6
499 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 30

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 34

Expert Comment

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

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 30

Expert Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now