Solved

PHP Question

Posted on 2014-04-23
6
508 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

Independent Software Vendors: 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!

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

691 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