Solved

PHP Question

Posted on 2014-04-23
6
507 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 35

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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

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

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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remaiā€¦
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

737 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