?
Solved

PHP Question

Posted on 2014-04-23
6
Medium Priority
?
510 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 1000 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 1000 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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 35

Expert Comment

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

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

Automating Terraform w Jenkins & AWS CodeCommit

How to configure Jenkins and CodeCommit to allow users to easily create and destroy infrastructure using Terraform code.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

770 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