Thank you very much, that helped.
cgull 25 Light Poster
cgull 25 Light Poster
I am using codeigniter 2.1.2 and Bootstrap.
I am opening a form in a modal window.
The form is inside a div with id status.
The form has a few input fields and an upload file field.
I am trying to submit the form with ajaxForm.
In my controller I echo "success" if everything is fine.
public function edit($provinceId, $bookId, $id = NULL)
{
$province = $this->province_m->get($provinceId);
$book = $this->book_m->get($bookId);
if($id)
{
$this->data['issue'] = $this->issue_m->get($id);
count($this->data['issue']) || $this->data['errors'][] = 'The issue could not be found.';
}
else
{
$this->data['issue'] = $this->issue_m->get_new();
}
// Set up the form
$rules = $this->issue_m->rules;
$this->form_validation->set_rules($rules);
// Checks if issue save was pressed, otherwise it will show the errors becuase of the post of province and book
if($this->input->post('issueposted') != '')
{
if ($this->form_validation->run() == TRUE)
{
$data = $this->issue_m->array_from_post(array('mag_folder'));
$data['province_id'] = $provinceId;
$data['book_id'] = $bookId;
$data['publish_date'] = mdate('%Y-%m-%d', strtotime($this->input->post('publish_date')));
if($_FILES['image']['error'] === 0)
{
$uploaded = $this->do_upload($province->folder, $book->name);
if($uploaded)
{
$data['image'] = $this->upload->file_name;
$this->issue_m->save($data, $id);
echo "success";
}
}
else //No file to upload
{
$this->issue_m->save($data, $id);
echo "success";
}
}
}
// Load the view
$this->data['url'] = site_url('admin/issue/edit') . '/' . $province->id . '/' . $book->id . '/' . $id;
$this->data['province'] = $province;
$this->data['book'] = $book;
$data = $this->load->view('admin/issue/edit', $this->data, TRUE);
$this->output->set_output($data);
}
}
The javascript:
$(function() {
var options = {
target: '#status',
success: function(data) {
alert(data);
window.location.replace("http://thinklocal.dev/admin/province");
}
};
// pass options to ajaxForm
$('#issueform').ajaxForm(options);
});
Everything worked fine besides the fact that the page was not redirecting on …
cgull 25 Light Poster
Hello,
I am trying to create a menu that slides up when a button is clicked.
I looked at a lot of tutorials of animate and slide but nothing works for me.
I hope someone can help.
What I need is a button that says: Click for Menu and when this button is clicked I need the menu (ul list) to display above the button and on top of the content under it. So I don't want the content to move.
For example:
<div id="content">
Text for content here
<ul class="menu">
<li><a href="about">A</a></li>
<li><a href="about">B</a></li>
<li><a href="about">C</a></li>
</ul>
<a href="#">Click for Menu</a>
</div>
When the Click for Menu link is clicked the menu will slide from the button up above everything.
Hope you understand what I mean.
Can someone please help?
cgull 25 Light Poster
Any information that you can provide with regard to the known issue and how you actually solved it would be helpful for others that come across this thread with a similiar issue.
I think the information is in the post?
Dev server was set up to display php errors and live server was set up to not display php errors.
cgull 25 Light Poster
FOUND IT !!!!!
Oh dear, I have a php warning that was not shown on the live server but is shown on the dev server.
But this warning appears only on some of the accordion tabs so I didn't see it on the dev server as well until I moved to a different tab.
That's what created the extra space and made the div look higher....
OHHHHHHHHHHHHHHHH
:)
cgull 25 Light Poster
Tried to add: <div style="max-height: 300px">
that helped on the local site, but of course, I don't want to add this rule, it was just for testing.
Maybe I should also add, that this div has also the Bootstrap row class added to it. Don't know if it matters in this case.
cgull 25 Light Poster
Yes, browsing local and live on the same browser, Firefox.
Yes, added height to the div style like so:<div style="height: 400px;"
>
Live changed to 400px, local stayed the same.
How strange is that?
And the funny thing, for once, things are working as I want on the live server.... but still... lol
cgull 25 Light Poster
Hello,
Using codeigniter 2.1.2 and Bootstrap 2.3.1.
I have just uploaded files from a local site to a live server.
Somehow a div inside an accordion div gets different heights:
On my local site I have this div:
<div id="ui-accordion-1-panel-0" class="row ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active" style="padding: 0.5em 0px; display: block; height: 529.2px;" aria-labelledby="ui-accordion-1-header-0" role="tabpanel" aria-expanded="true" aria-hidden="false">
On the live site the same div had a different height:
<div id="ui-accordion-1-panel-0" class="row ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active" style="padding: 0.5em 0px; display: block; height: 279.2px;" aria-labelledby="ui-accordion-1-header-0" role="tabpanel" aria-expanded="true" aria-hidden="false">
My code:
<div class="accordion">
<?php foreach($provinces as $province): ?>
<h3><?php echo $province->name; ?></h3>
<div class="row" style="padding: .5em 0;">//This is the div that gets different heights
How can that happen?
cgull 25 Light Poster
cerel, thanks but adding your code just makes the Apache server stop working.
Restarting WAMP, and apache does not start and there is no error in the error log file.
I tried 3 ways:
<Directory /> # relation with DocumentRoot
<Directory "c:/wamp/www/thinklocal"> # relation with DocumentRoot
<Directory c:/wamp/www/thinklocal> # relation with DocumentRoot
cgull 25 Light Poster
Hi,
Sorry saw your answer only now. Didn't help.
Posting what I did again as I am trying to do it for a few days now and the situation might have changed:
I am trying to create Virtual hosts for 3 days now.
I even managed to break WAMP totally and had to reinstall it.
I read lots of tutorials and forum posts.
Nothing works !!!
PLEASE HELP ME
Windows 7, WAMP 2.2e
I have 2 local sites, ruthrudincom and thinklocal.
If I leave them both in wamp/www - ruthrudincom is working thinklocal gives me access denied.
Thinklocal is developed with codeigniter and has htaccess file.
If I move them to c:/www none is working - access denied. (I went to c:/www and gave all permissions to all users)
My files:
httpd_conf:
<Directory "c:/wamp/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
# Online --> Require …
cgull 25 Light Poster
Hello,
I am searching the net for hours now trying to find a solution to my problem, found tutorials and forums posts but can't solve my problem.
Please help.
windows 7, WAMP 2.2 (apache 2.4.2)
Trying to set up a virtual host outside of the wamp directory getting the error:
You don't have permission to access / on this server.
What I have now:
directory: c:\sites
Permissions:
Full Control:
Authenticated Users
SYSTEM
Administrators(MYUSERNAME\Administrators)
Users(MYUSERNAME\Users)
In my httpd-vhosts.conf file, under:
<VirtualHost *:80>
DocumentRoot "C:/sites/highland"
ServerName highland.local
Options Indexes FollowSymLinks
</VirtualHost>
In my httpd.conf file:
DocumentRoot "c:/wamp/www/"
<Directory "c:/wamp/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
# Online --> Require all granted
# onlineoffline tag - don't remove
Require local
</Directory>
DocumentRoot "c:/sites/"
<Directory "c:/sites/">
AllowOverride All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
In my hosts file:127.0.0.1 …
cgull 25 Light Poster
Hello good people of Daniweb :)
I am developing a site with codeigniter 1.2.2 and the latest version of bootstrap.
I am calling a modal window but the X and Close buttons don't close the window.
Tried alerting when clicking a button and I do get the alert but the window stays open.
Can someone please help?
My page source:
<html>
<head>
<meta charset="UTF-8">
<title>thinklocal: thinklocal</title>
<!-- Bootstrap -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="http://localhost/thinklocal/css/bootstrap.min.css" rel="stylesheet">
<link href="http://localhost/thinklocal/css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="http://localhost/thinklocal/css/styles.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://localhost/thinklocal/js/bootstrap.min.js"></script>
<script>
$(function() {
$('.btn').click(function() { alert('h');
$('#myModal').modal('hide');
});
});
</script>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body style="background: #555;">
<div id="myModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<h2 id="myModalLabel">View Back Issues</h2>
</div>
<div class="modal-body">
<table class="table table-hover">
<thead>
<tr>
<th>Issue Date</th>
<th>View Issue</th>
</tr>
</thead>
<tbody>
<tr>
<td>01122012</td>
<td><img class="thumb" src="http://localhost/thinklocal/uploads/issues/freestate/thinklocal/img/dec2012.jpg" /></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
© 2013 thinklocal </div>
</div>
<script>
$(function() {
$('.btn').click(function() { alert('h');
$('#myModal').modal('hide');
});
});
</script>
</body>
</html>
cgull 25 Light Poster
Ok, got it to work. With all my testings, I added this: $(function) {
before my mask, now with gon's new file, and removing the function, it works.
Thank you all for all the help !!!
cgull 25 Light Poster
gon1387 tried your link, getting the same error. My page is calling the javascript files.
cgull 25 Light Poster
Ok, the first alert gives: function the second undefined.
When I go to the page source and click on the maskedinput js file, it goes to the file.
cgull 25 Light Poster
I am working on my local computer.
The javascript files are included, I checked.
The / does not need to be there, it was actually wrong to have it there.
I am also calling jquery like this now:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
And other jquery scripts on the page work fine. It just the mask that does not work.
cgull 25 Light Poster
I am working on my local computer.
The javascript files are included, I checked.
The / does not need to be there, it was actually wrong to have it there.
I am also calling jquery like this now:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
And other jquery scripts on the page work fine. It just the mask that does not work.
cgull 25 Light Poster
Hello,
I have downloaded the plugin maskedinput from: Click Here
Trying to use it on a site I am developing with codeigniter and foundation framework, the index.html file that comes with it works well on my site, I get this error: TypeError: $(...).mask is not a function
The jquery files are included, I checked.
My code is exactly like the example.
In my head tag:
<script src="<?php echo $templateAssets; ?>javascripts/jquery-1.9.0.min.js"></script>
<script src="<?php echo $templateAssets; ?>javascripts/jquery.maskedinput.min.js"></script>
<script src="<?php echo $templateAssets;?>/javascripts/modernizr.foundation.js"></script>
I have an input with a phone id:
<?php
$phone = array('name'=>'phone', 'id'=>'phone', 'value'=>set_value('phone'));
echo form_label('Phone Number', 'phone');
?>
<div class="row">
<div class="six columns">
<?php echo form_input($phone); ?>
</div>
</div>
And my jquery:$('#phone').mask("(999) 999-9999");
Why do I get this error?
cgull 25 Light Poster
All is good, echo helped.
Hair is back, nothing to see here...
cgull 25 Light Poster
OH MY GOD !!!! LOL wow, thank you for taking the time to help, I am so impressed !!!
If you were my neighbour I would buy you a bottle of wine.
And I love the Double Facepalm... just love it! You're a star !!!
cgull 25 Light Poster
Hello,
I am developing a web site with codeigniter.
I have a form where I have a few group radio buttons.
When validation fails, one group radio keeps its value but the other doesn't.
I can't find why.
My code for the radio that does not work:
<label for="accommodationYes" class="accomm" id="accommY">
<input name="accommodation" type="radio" id="accommodationYes" style="display:none;" value="Yes"<?php set_radio('accommodation', 'Yes'); ?>>
<span class="custom radio"></span> Yes
</label>
<label for="accommodationNo" class="accomm" id="accomN">
<input name="accommodation" type="radio" id="accommodationNo" style="display:none;" value="No"<?php set_radio('accommodation', 'No'); ?>>
<span class="custom radio"></span> No
</label>
My code for the radio group that does work:
<label for="eft"><input name="payment" type="radio" id="eft" style="display:none;" value="EFT"<?php echo set_radio('payment', 'EFT'); ?>><span class="custom radio"></span> EFT</label>
<label for="cash"><input name="payment" type="radio" id="cash" style="display:none;" value="Cash"<?php echo set_radio('payment', 'Cash'); ?>><span class="custom radio"></span> Cash</label>
<label for="cheque"><input name="payment" type="radio" id="cheque" style="display:none;" value="Cheque"<?php echo set_radio('payment', 'Cheque'); ?>><span class="custom radio"></span> Cheque</label>
My validation code:
$this -> form_validation -> set_rules('accommodation', 'Accommodation', 'required|xss_clean' );
$this -> form_validation -> set_rules('payment', 'Payment', 'required|xss_clean' );
Can someone please help me find the problem?
cgull 25 Light Poster
Hi, wouldn't stop just stop it altogehter and won't start again? Thanks
cgull 25 Light Poster
Hello,
I am trying to create a jquery banner.
I found lots of tutorials and managed to create a banner but I still need some help.
I have 4 divs:
First div slides from top
Then
Second div fades in
Then
Third div fades in and changes it's width
Then
Fourth div slides from botton to top
My question is, is there a way to pause or delay all the animations together after the last animation finished.
Also, is there a better way to do what I did since I am quite confused with all the tutorials.
My html:
<div id="bannerTop"><img src="<?=site_url()?>assets/images/events/centenaryTop_01.png" class="ca_shown" alt=""/></div>
<div id="bannerTopTwo"><img src="<?=site_url()?>assets/images/events/centenaryTop_02.png" class="ca_shown" alt=""/></div>
<div id="bannerDest"><img src="<?=site_url()?>assets/images/events/centenaryDestination.png" class="ca_shown" alt=""/></div>
<div id="bannerBottom"><img src="<?=site_url()?>assets/images/events/centenaryBottom.png" class="ca_shown" alt="" /></div>
My jquery:
var calls = [];
function executeNext(next) {
if(calls.length == 0) return;
var fnc = calls.pop();
fnc();
if(next) { executeNext(true); }
}
/*To call method chain synchronously*/
calls.push(bannerTop);
calls.push(bannerTopTwo);
calls.push(bannerDest);
calls.push(bannerBottom);
executeNext(true);
function bannerTop()
{
$("#bannerTop").animate({top:"+=65px", opacity: "1"},1000).delay(5000).animate({top: "-=65px", opacity: "0"}, 0);
setTimeout("bannerTop()",3000);
}
function bannerTopTwo()
{
$('#bannerTopTwo').delay(1000);
$("#bannerTopTwo").animate({opacity: "1"}, 1500).delay(3500).animate({opacity: "0"}, 0);
setTimeout("bannerTopTwo()",3000);
}
function bannerDest()
{
$('#bannerDest').delay(2000);
$("#bannerDest").animate({width: "225", opacity: "1"}, 1000).delay(3000).animate({width: "0", opacity: "0"}, 0);
setTimeout("bannerDest()",3000);
}
function bannerBottom()
{
$('#bannerBottom').delay(3000);
$("#bannerBottom").animate({top: "-=50", opacity: "1"}, 1000).delay(2000).animate({top: "235", opacity: "0"}, 0);
setTimeout("bannerBottom()",3000);
}
Thank you :)
cgull 25 Light Poster
After more reading, I did a few more things:
I've disabled the DIVX plugins in ie9
I've added this line first thing in the head tag:<meta http-equiv="X-UA-Compatible" content="IE=9" />
Nothing helps :( Grrrrrrrrrrrrrrrrrrrrrr..... we should all ban IE from our websites. Put a big red message:
We do not support IE, please use a different browser.
cgull 25 Light Poster
Another thing, when I check ie9 with F12, on the top it says:
Browser Mode: IE9 Document Mode: IE9 standards.
Don't know if it matters but I thought I should mention it.
cgull 25 Light Poster
Thank you.
I am getting this error:
SCRIPT65535: Invalid calling object
orderonline, line 1 character 1
My page is validated by the Markup validation service.
I've tried two doctypes, both give me the error:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
and<!DOCTYPE html> <html>
What am I doing wrong?
cgull 25 Light Poster
Didn't get your responses by email but thank you.
Found the solution today:
Added visibilty: visible;
on #menu ul li ul
Thank you
cgull 25 Light Poster
Hello,
I have a sprite dropdown menu that works fine everywhere besides IE9. In IE9 the menu just doesn't drop.
I have search the net for 2 days trying to find a solution with no success.
My html code:
<div id="nav">
<div id="menu">
<ul>
<?php
if($title == "Home"):
echo '<li class="selected"><a href="#" class="home">Home</a></li>';
else:
echo '<li><a href="' . base_url() . 'main" id="home" class="home">Home</a></li>';
endif;
if($title == "About Us"):
echo '<li class="selected"><a href="#" class="about">About Us</a></li>';
else:
echo '<li><a href="' . base_url() . 'main/about" class="about">About Us</a></li>';
endif;
if($title == "Our Coffees"):
echo '<li class="selected"><a href="#" class="coffee">Our Coffees</a></li>';
else:
echo '<li><a href="' . base_url() . 'main/ourcoffees" class="coffee">Our Coffees</a></li>';
endif;
echo '<li><a href="#" class="order">Order Online</a>
<ul id="subNav">
<li><a href="' . site_url() . 'orderonline">Coffee</a></li>
<li><a href="' . site_url() . 'orderonline/books">Books</a></li>
</ul>
</li>';
if($title == "Gallery"):
echo '<li class="selected"><a href="#" class="gallery">Gallery</a></li>';
else:
echo '<li><a href="' . base_url() . 'main/gallery" class="gallery">Gallery</a></li>';
endif;
if($title == "Contact Us"):
echo '<li class="selected"><a href="#" class="contact">Contact Us</a></li>';
else:
echo '<li><a href="' . base_url() . 'contact" class="contact">Contact Us</a></li>';
endif;
?>
</ul>
</div>
</div><!-- end nav -->
My css:
#nav {
float: right;
z-index: 100;
width: 735px;
height: 81px;
position: relative;
}
#menu
{
clear: both;
margin-top: 23px;
}
#menu ul { list-style: none; }
#menu ul li
{
float: left;
}
/*menu-styling ] on / hover states [*/
#menu ul li a
{
background: transparent url(../images/menu.png) repeat scroll 0 0;
height: 81px;
text-decoration: none;
display: block;
}
#menu ul li a.home{width: 83px; text-indent: -99999px;}
#menu ul li a.home:hover{background-position: 0 -81px; …
cgull 25 Light Poster
Hello,
I have a problem with an Ajax call on IE9.
I have searched the internet and this forum for solutions for a few hours and can't find an answer.
I have a coffee roastery site (developed with Codeigniter), where the users can order coffee bags online.
The user selects the blend and the quantity he wants and press a button to display the updated quantities on the right side of the screen.
Of course, works find everywhere besides IE9.
The problem is that in IE9 it just displays the last value the user added and not all the values that were there before. The page needs to be refreshed in order to see all the quantities added.
The jQuery code on the page:
<script type="text/javascript">
$(".grindform").submit(function() {
var productId = $('#productId').val();
var selected = $(this);
var weight = $('#selectedWeight').val();
var qtyEsp = $('#qtyEsp').val();
var qtyFilter = $('#qtyFilter').val();
var qtyPlunger = $('#qtyPlunger').val();
var qtyTurkish = $('#qtyTurkish').val();
var qtyBeans = $('#qtyBeans').val();
var eroast = $('#eroast').val();
var froast = $('#froast').val();
var proast = $('#proast').val();
var troast = $('#troast').val();
var broast = $('#broast').val();
$.ajax({
type: "POST",
url: "<?php echo base_url();?>order/orderonline/addCartItem",
data: {productId: productId, weight: weight, ajax: '1', qtyEsp: qtyEsp, qtyFilter: qtyFilter, qtyPlunger: qtyPlunger, qtyTurkish: qtyTurkish, qtyBeans: qtyBeans, eroast: eroast, froast: froast, proast: proast, troast: troast, broast: broast},
success: function(data){
if(data == 'true')
{
$.get("<?php echo base_url(); ?>order/orderonline/showCart" + new Date().getTime(), function(cart)
{
console.log(cart);
$("#cartContent").html(cart);
selected.parent().slideToggle();
});
$('#k').show();
$('#g').show();
}
else if(data != '')
{
$('#selectQty').html(data);
}
if(data == '')
{
alert("Product does …
cgull 25 Light Poster
Hello,
I am trying to create dynamic dropdown lists with PHP MySQL and AJAX.
When a user selects a category from the first dropdown, the subcategory dropdown should populate with all the sub categories that belong to the selected category.
I am using Fuel CMS as my framework.
In my controller I have this code:
$options = $this->sub_categories_model->find_all(array('cat_id'=>$catId), 'title asc');
$arr = array();
foreach($options as $opt):
$arr[] = array('id'=>$opt->id, 'title'=>$opt->title);
endforeach;
In my view my html select:
<select name="category" id="category">
<option value="6" label="Community">Community</option>
<option value="1" label="For Sale">For Sale</option>
<option value="2" label="Need a Lift">Need a Lift</option>
<option value="3" label="Property">Property</option>
<option value="5" label="Services">Services</option>
<option value="4" label="Vehicles">Vehicles</option>
</select>
<select id="subcatetory"></select>
My jquery code:
$('#category').change(function()
{
var catId = $(this).val();
var select = $('#subcategory');
if(select.prop)
var options = select.prop('options');
else
var options = select.attr('options');
$('option', select).remove();
$.ajax({
type: "POST",
url: "<?php echo site_url(); ?>postanad/getSubCategories",
data: {catId: catId},
success: function(data)
{
console.log(data);
$.each(data, function(i, val)
{
//options[options.length] = new Option(val, i);
console.log(val);
});
}
});
});
If I code in my controller: print_r($arr);
In my view I see this:
Array (
[0] => Array ( [id] => 3 [title] => Clothes & Accessories )
[1] => Array ( [id] => 1 [title] => Electronics )
[2] => Array ( [id] => 4 [title] => Home & Garden )
[3] => Array ( [id] => 5 [title] => Miscellaneous )
[4] => Array ( [id] => 2 [title] => Sports & Leisure )
)
If I code …
cgull 25 Light Poster
Hello,
I never used cron jobs before and now I have this scenario:
I have a table with a Boolean column called: new.
I need to check this table every day, and if the record was created 30 days ago, I need to update the column to False.
Do I do this with a cron job?
I read lots of posts and articles about cron job but still not sure I understand if that is what I need... confusion...
Thank you
cgull 25 Light Poster
I have tried another code, this one works well everywhere, besides Chrome Mac version 19.0.1084.56
Jquery Code:
var $$ = $.fn;
$$.extend({
SplitID : function()
{
return this.attr('id').split('-').pop();
},
Slideshow : {
Ready : function()
{
this.Counter = 1;
this.Interrupted = false;
this.Transition();
},
Transition : function()
{
if (this.Interrupted) {
return;
}
this.Last = this.Counter - 1;
if (this.Last < 1) {
this.Last = 3;
}
$('div#tmpSlide-' + this.Last).fadeOut(
'slow',
function() {
// $('div#tmpSlideshowControl-' + $$.Slideshow.Last).removeClass('tmpSlideshowControlActive');
// $('div#tmpSlideshowControl-' + $$.Slideshow.Counter).addClass('tmpSlideshowControlActive');
$('div#tmpSlide-' + $$.Slideshow.Counter).fadeIn('slow');
$$.Slideshow.Counter++;
if ($$.Slideshow.Counter > 3) {
$$.Slideshow.Counter = 1;
}
setTimeout('$$.Slideshow.Transition();', 5000);
}
);
}
}
});
$(document).ready(
function() {
$$.Slideshow.Ready();
}
);
Css code:
div#slideshow {
position: relative;
width: 212px;
height: 210px;
border: 1px solid #aaa;
background: #fff;
}
div.slide {
position: absolute;
top: 0;
left: 0;
width: 210px;
height: 207px;
display: none;
z-index: 100;
}
div.slide img {
float: left;
}
div.slideCopy {
color: #aaa7a7;
font-weight: bold;
text-align: center;
font-size: 11px;
width: 210px;
float: left;
margin-top: 10px;
}
Html code:
<div id="slideshow">
<div id="tmpSlide-1" class="slide">
<a href="index.php?content=judaicart"><img src="images/slide/1.jpg" alt="1" /></a>
<div class="slideCopy"><p>1 / <span class="red">Judaic Art</span></p></div>
</div>
<div id="tmpSlide-2" class="slide">
<a href="index.php?content=judaicart"><img src="images/slide/2.jpg" alt="2" /></a>
<div class="slideCopy"><p>2 / <span class="red">Judaic Art</span></p></div>
</div>
<div id="tmpSlide-3" class="slide">
<a href="index.php?content=judaicart"><img src="images/slide/3.jpg" alt="3" /></a>
<div class="slideCopy"><p>3 / <span class="red">Judaic Art</span></p></div>
</div>
<div id="tmpSlide-4" class="slide">
<a href="index.php?content=judaicart"><img src="images/slide/4.jpg" alt="4" /></a>
<div class="slideCopy"><p>4 / <span class="red">Judaic Art</span></p></div>
</div>
</div>
cgull 25 Light Poster
Hello,
I am trying some code I found on the net for a fade in/ fade out slideshow.
It is working fine on FF, Chrome and Safari on Windows.
On Chrome Mac, the slides appearing one below the other, on IE8 on Windows, the text under the slide, does not fade, it just displays all the text above each other.
The jquery code:
function slideSwitch() {
var $active = $('#slideshow div.active');
if ( $active.length == 0 )
$active = $('#slideshow div:last');
var $next = $active.next().length ? $active.next()
: $('#slideshow div:first');
$active.addClass('last-active')
.animate({opacity : 0.0}, 1000);
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval( "slideSwitch()", 5000 );
});
The css:
#slideshow {
position: relative;
width: 212px;
height: 210px;
border: 1px solid #aaa;
background: #fff;
}
#slideshow div {
position: absolute;
top: 0;
left: 0;
z-index: 8;
opacity: 0.0;
}
#slideshow div.active {
z-index: 10;
opacity: 1.0;
}
#slideshow div.last-active {
z-index:9;
}
p.slideTitle {
color: #aaa7a7;
font-weight: bold;
padding-top: 10px;
text-align: center;
}
The html:
<div id="slideshow">
<div class="active"><a href="index.php?content=judaicart"><img src="images/slide/1.jpg" alt="" /></a>
<p class="slideTitle">1 / <span class="red">Judaic Art</span></p>
</div>
<div><a href="index.php?content=judaicart"><img src="images/slide/2.jpg" alt="" /></a><p class="slideTitle">2 / <span class="red">Judaic Art</span></p></div>
<div><a href="index.php?content=judaicart"><img src="images/slide/3.jpg" alt="" /></a><p class="slideTitle">3 / <span class="red">Judaic Art</span></p></div>
<div><a href="index.php?content=judaicart"><img src="images/slide/4.jpg" alt="" /></a><p class="slideTitle">4 / <span class="red">Judaic Art</span></p></div>
<div><a href="index.php?content=judaicart"><img src="images/slide/5.jpg" alt="" /></a><p class="slideTitle">5 / <span class="red">Judaic Art</span></p></div>
</div>
Can anyone please help me solve this? I'm not an expert on Jquery so any help would …
cgull 25 Light Poster
My solution to this question:
In the jquery script I am getting the category id from the link and calling my controller's function that calls the model to get the products. Then displays the result in a div with id productsList.
$('.cat').click(function(e) {
e.preventDefault();
var id = $(this).attr('id');
$("#productList").show();
$.ajax({
type: "POST",
url: "/orders/index.php/processOrder/getProducts",
data: {catId: id},
success: function(data){
$("#productList").html(data);
}
});
});
pritaeas commented: Thanks for sharing +14
cgull 25 Light Poster
Thanks, but yes, this is already solved. :) Thank you very much for taking the time to answer.
cgull 25 Light Poster
Hello,
I've just started learning codeigniter and struggling with ajax calls.
Found a few tutorials but can't understand how to do what I want.
I have a home_view with links, and when I click on a link I want it to fetch data from the database with the given id.
Then display a list of the records recieved from the database.
For example:
If the user clicks the Bread Rolls link, it should find all the records that belong to Bread Rolls in the products table and display them in the productsList div, in the categories_view file.
The jquery code is in the header_view file.
I am attaching my view, controller and model files.
Can someone please help?
<div id="category">
<ul>
<?php
foreach($cats as $cat)
{
echo '<li><a href="#" id="' . $cat['id'] . '" class="cat">' . $cat['name'] . "</a></li>";
}
?>
</ul>
</div>
<div class="clear"></div>
<div id="productList"></div><!-- Will be filled with an ajax call -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The Millery</title>
<?php $this->load->helper('url'); ?>
<link href="<?php echo base_url(); ?>css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.cat').click(function() {
var catId = $(this).attr('id');
if (catId != ""){
$.get('/index.php/home/productsList'+catId, function(data){
$(this).parents('div').append(data);
})
}//end if
});
});
</script>
</head>
<body>
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
session_start(); //we need to call PHP's session object to access it through CI
class Home extends CI_Controller
{
function __construct()
{
parent::__construct();
}
function index()
{
if($this->session->userdata('logged_in'))
{
$this->load->model('m_categories');
$this->load->model('m_products');
$session_data = $this->session->userdata('logged_in');
$data['username'] = $session_data['username'];
$this->load->view('header_view');
$this->load->view('home_view', $data);
$this->getCategories();
}
else
{
//If no session, redirect to login page
redirect('login', 'refresh');
}
}
function logout()
{
$this->session->unset_userdata('logged_in');
session_destroy();
redirect('home', 'refresh');
}
function getCategories()
{
$data['cats'] = array();
$result = $this->m_categories->getCategories();
if($result)
{
foreach($result as $row)
{
$id = $row->id;
$name = $row->name;
array_push($data['cats'], array('id'=>$id, 'name'=>$name));
}
$this->load->view('categories_view', $data);
}
}
function getProducts($catId)
{
$data['products'] = array();
$result = $this->m_products->getProducts($catId);
if($result)
{
foreach($result as $row)
{
$id = $row->id;
$name = $row->name;
array_push($data['products'], array('id'=>$id, 'name'=>$name));
}
}
$this->load->view('productList_view',$data);
}
function productsList()
{
$this->load->model('m_products','', TRUE);
$data['products'] = $this->m_products->getProducts($this->params['catId']);
$this->load->view('productList', $data);
}
}
<h1>Home</h1>
<h2>Welcome <?php echo $username; ?>!</h2>
<a href="home/logout">Logout</a>
<div id="content">
</div>
<?php
Class M_Products extends CI_Model
{
function getProducts($catId)
{
$this -> db -> select('*');
$this -> db -> from('products');
$this -> db -> where('catId = $catId');
echo "Here $catId<br />";
$query = $this -> db -> get();
if($query -> num_rows() >= 1)
{
return $query->result();
}
else
{
return false;
}
}
}
cgull 25 Light Poster
Hi Buppy,
You are a STAR !!!
I moved the code before the DOCTYPE and now my hair starts growing again :)
THANK YOU !
cgull 25 Light Poster
Hello,
I know this question was answered many times, and I looked at the answers but still can't find a solution.
I have an index file that includes a contact form.
The contact form action is itself, and if the form succeeds it should redirect to index.php?content=thankyou
Althought the form is being sent successfuly, it does not redirect to index.php?content=thankyou, it tries to go again to itself: index.php?content=contact and I get the "cannot modify header..." error.
I've added ob_start, ob_flush, I checked for spaces after php codes, or anywhere else, nothing helps.
I am attaching the index, contact and the form class files.
The problem might be in the index file line: 56, or on the fgcontactform file line: 143.
I am losing hair here, please, can someone help?
<!-- Form Code Start -->
<div class="inner" style="padding-top: 40px;">
<div style="width: 345px; margin: 0 auto;">
<form id='contactus' action='<?php echo $formproc->GetSelfScript(); ?>?content=contact' method='post' accept-charset='UTF-8'>
<fieldset >
<legend>Sigal Zahavi - Contact</legend>
<input type='hidden' name='submitted' id='submitted' value='1'/>
<input type='hidden' name='<?php echo $formproc->GetFormIDInputName(); ?>' value='<?php echo $formproc->GetFormIDInputValue(); ?>'/>
<input type='text' class='spmhidip' name='<?php echo $formproc->GetSpamTrapInputName(); ?>' />
<h3>083 289 5280</h3>
<div class='short_explanation'>* Required fields</div>
<div><span class='error'><?php echo $formproc->GetErrorMessage(); ?></span></div>
<div class='container'>
<label for='name' >Name:* </label><br/>
<input type='text' name='name' id='name' value='<?php echo $formproc->SafeDisplay('name') ?>' maxlength="50" /><br/>
<span id='contactus_name_errorloc' class='error'></span>
</div>
<div class='container'>
<label for='email' >Email:*</label><br/>
<input type='text' name='email' id='email' value='<?php echo $formproc->SafeDisplay('email') ?>' maxlength="50" /><br/>
<span id='contactus_email_errorloc' class='error'></span>
</div>
<div class='container'>
<label for='email' >Phone:</label><br/>
<input type='text' name='phone' id='phone' value='<?php echo $formproc->SafeDisplay('phone') ?>' maxlength="10" />
</div>
<div class='container'>
<label for='message' >Message:*</label><br/>
<span id='contactus_message_errorloc' class='error'></span>
<textarea rows="10" cols="50" name='message' id='message'><?php echo $formproc->SafeDisplay('message') ?></textarea>
</div>
<div class='container'>
<input type='submit' name='Submit' value='Send' />
</div>
</fieldset>
</form>
</div>
</div>
<!-- client-side Form Validations:
Uses the excellent form validation script from JavaScript-coder.com-->
<script type='text/javascript'>
// <![CDATA[
var frmvalidator = new Validator("contactus");
frmvalidator.EnableOnPageErrorDisplay();
frmvalidator.EnableMsgsTogether();
frmvalidator.addValidation("name","req","Please enter your name");
frmvalidator.addValidation("email","req","Please enter your email address");
frmvalidator.addValidation("email","email","The email address you have entered is not valid");
frmvalidator.addValidation("message","req","Please write a message");
frmvalidator.addValidation("message","maxlen=2048","Your message is over the size limit!(More than 2KB!)");
// ]]>
</script>
The attachment preview is chopped off after the first 10 KB. Please download the entire file.
<?PHP
/*
Contact Form from HTML Form Guide
This program is free software published under the
terms of the GNU Lesser General Public License.
This program is distributed in the hope that it will
be useful - WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
@copyright html-form-guide.com 2010
*/
require_once("class.phpmailer.php");
/*
Interface to Captcha handler
*/
class FG_CaptchaHandler
{
function Validate() { return false;}
function GetError(){ return '';}
}
/*
FGContactForm is a general purpose contact form class
It supports Captcha, HTML Emails, sending emails
conditionally, File atachments and more.
*/
class FGContactForm
{
var $receipients;
var $errors;
var $error_message;
var $name;
var $email;
var $phone;
var $message;
var $from_address;
var $form_random_key;
var $conditional_field;
var $arr_conditional_receipients;
var $fileupload_fields;
var $captcha_handler;
var $mailer;
function FGContactForm()
{
$this->receipients = array();
$this->errors = array();
$this->form_random_key = 'HTgsjhartag';
$this->conditional_field='';
$this->arr_conditional_receipients=array();
$this->fileupload_fields=array();
$this->mailer = new PHPMailer();
$this->mailer->CharSet = 'utf-8';
}
function EnableCaptcha($captcha_handler)
{
$this->captcha_handler = $captcha_handler;
session_start();
}
function AddRecipient($email,$name="")
{
$this->mailer->AddAddress($email,$name);
}
function SetFromAddress($from)
{
$this->from_address = $from;
}
function SetFormRandomKey($key)
{
$this->form_random_key = $key;
}
function GetSpamTrapInputName()
{
return 'sp'.md5('KHGdnbvsgst'.$this->GetKey());
}
function SafeDisplay($value_name)
{
if(empty($_POST[$value_name]))
{
return'';
}
return htmlentities($_POST[$value_name]);
}
function GetFormIDInputName()
{
$rand = md5('TygshRt'.$this->GetKey());
$rand = substr($rand,0,20);
return 'id'.$rand;
}
function GetFormIDInputValue()
{
return md5('jhgahTsajhg'.$this->GetKey());
}
function SetConditionalField($field)
{
$this->conditional_field = $field;
}
function AddConditionalReceipent($value,$email)
{
$this->arr_conditional_receipients[$value] = $email;
}
function AddFileUploadField($file_field_name,$accepted_types,$max_size)
{
$this->fileupload_fields[] =
array("name"=>$file_field_name,
"file_types"=>$accepted_types,
"maxsize"=>$max_size);
}
function ProcessForm()
{
if(!isset($_POST['submitted']))
{
return false;
}
if(!$this->Validate())
{
$this->error_message = implode('<br/>',$this->errors);
return false;
}
$this->CollectData();
$ret = $this->SendFormSubmission();
return $ret;
}
function RedirectToURL($url)
{
header("Location: $url");
exit;
}
function GetErrorMessage()
{
return $this->error_message;
}
function GetSelfScript()
{
return htmlentities($_SERVER['PHP_SELF']);
}
function GetName()
{
return $this->name;
}
function GetEmail()
{
return $this->email;
}
function GetPhone()
{
return $this->phone;
}
function GetMessage()
{
return htmlentities($this->message,ENT_QUOTES,"UTF-8");
}
/*-------- Private (Internal) Functions -------- */
function SendFormSubmission()
{
$this->CollectConditionalReceipients();
$this->mailer->CharSet = 'utf-8';
$this->mailer->Subject = "Contact form submission from sigalz.co.za by $this->name";
$this->mailer->From = $this->GetFromAddress();
$this->mailer->FromName = $this->name;
$this->mailer->AddReplyTo($this->email);
$message = $this->ComposeFormtoEmail();
$textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message)));
$this->mailer->AltBody = @html_entity_decode($textMsg,ENT_QUOTES,"UTF-8");
$this->mailer->MsgHTML($message);
$this->AttachFiles();
if(!$this->mailer->Send())
{
$this->add_error("Failed sending email!");
return false;
}
return true;
}
function CollectConditionalReceipients()
{
if(count($this->arr_conditional_receipients)>0 &&
!empty($this->conditional_field) &&
!empty($_POST[$this->conditional_field]))
{
foreach($this->arr_conditional_receipients as $condn => $rec)
{
if(strcasecmp($condn,$_POST[$this->conditional_field])==0 &&
!empty($rec))
{
$this->AddRecipient($rec);
}
}
}
}
/*
Internal variables, that you donot want to appear in the email
Add those variables in this array.
*/
function IsInternalVariable($varname)
{
$arr_interanl_vars = array('scaptcha',
'submitted', 'Submit',
$this->GetSpamTrapInputName(),
$this->GetFormIDInputName()
);
if(in_array($varname,$arr_interanl_vars))
{
return true;
}
return false;
}
function FormSubmissionToMail()
{
$ret_str='';
foreach($_POST as $key=>$value)
{
if(!$this->IsInternalVariable($key))
{
$value = htmlentities($value,ENT_QUOTES,"UTF-8");
$value = nl2br($value);
$key = ucfirst($key);
$ret_str .= "<div class='label'>$key :</div><div class='value'>$value </div>\n";
}
}
foreach($this->fileupload_fields as $upload_field)
{
$field_name = $upload_field["name"];
if(!$this->IsFileUploaded($field_name))
{
continue;
}
$filename = basename($_FILES[$field_name]['name']);
$ret_str .= "<div class='label'>File upload '$field_name' :</div><div class='value'>$filename </div>\n";
}
return $ret_str;
}
function ExtraInfoToMail()
{
$ret_str='';
$ip = $_SERVER['REMOTE_ADDR'];
$ret_str = "<div class='label'>IP address of the submitter:</div><div class='value'>$ip</div>\n";
return $ret_str;
}
function GetMailStyle()
{
$retstr = "\n<style>".
"body,.label,.value { font-family:Arial,Verdana; direction: rtl;} ".
".label {font-weight:bold; margin-top:5px; font-size:1em; color:#333;} ".
".value {margin-bottom:15px;font-size:0.8em;padding-left:5px;} ".
"</style>\n";
return $retstr;
}
function GetHTMLHeaderPart()
{
$retstr = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'."\n".
'<html><head><title></title>'.
'<meta http-equiv=Content-Type content="text/html; charset=utf-8">';
$retstr .= $this->GetMailStyle();
$retstr .= '</head><body>';
return $retstr;
}
function GetHTMLFooterPart()
{
$retstr ='</body></html>';
return $retstr ;
}
function ComposeFormtoEmail()
{
$header = $this->GetHTMLHeaderPart();
$formsubmission = $this->FormSubmissionToMail();
$extra_info = $this->ExtraInfoToMail();
$footer = $this->GetHTMLFooterPart();
$message = $header."Information request from sigalz.co.za<p>$formsubmission</p><hr/>$extra_info".$footer;
return $message;
}
function AttachFiles()
{
foreach($this->fileupload_fields as $upld_field)
{
$field_name = $upld_field["name"];
if(!$this->IsFileUploaded($field_name))
{
continue;
}
$filename =basename($_FILES[$field_name]['name']);
$this->mailer->AddAttachment($_FILES[$field_name]["tmp_name"],$filename);
}
}
function GetFromAddress()
{
if(!empty($this->from_address))
{
return $this->from_address;
}
$host = $_SERVER['SERVER_NAME'];
$from ="nobody@$host";
return $from;
}
function Validate()
{
$ret = true;
//security validations
if(empty($_POST[$this->GetFormIDInputName()]) ||
$_POST[$this->GetFormIDInputName()] != $this->GetFormIDInputValue() )
{
//The proper error is not given intentionally
$this->add_error("Automated submission prevention: case 1 failed");
$ret = false;
}
//This is a hidden input field. Humans won't fill this field.
if(!empty($_POST[$this->GetSpamTrapInputName()]) )
{
//The proper error is not given intentionally
$this->add_error("Automated submission prevention: case 2 failed");
$ret = false;
}
//name validations
if(empty($_POST['name']))
{
$this->add_error("Please enter your name");
$ret = false;
}
/*else
if(strlen($_POST['name'])>60)
{
$this->add_error("Name is too big!");
$ret = false;
}*/
//email validations
if(empty($_POST
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
ob_start();
if (!isset($_REQUEST['content']))
{
$page = "main";
$style = "main";
}
else
{
$page = $_REQUEST['content'];
$style = "submain";
}
switch ($page)
{
case "work":
$title = "Work Examples";
break;
case "education":
$title = "Education";
break;
case "employment":
$title = "Recent Employment";
break;
case "contact":
$title = "Contact Me";
break;
case "thankyou":
$title = "Thank you";
break;
default:
$title = "Home";
}
$nextPage = "content/$page.inc.php";
if($page == 'contact')
{
require_once("content/fgcontactform.php");
$formproc = new FGContactForm();
//1. Add your email address here.
//You can add more than one receipients.
$formproc->AddRecipient('webmaster@sigalz.co.za'); //<<---Put your email address here
//2. For better security. Get a random tring from this link: http://tinyurl.com/randstr
// and put it here
$formproc->SetFormRandomKey('NDFlEByCt2TkuxL');
if(isset($_POST['submitted']))
{
if($formproc->ProcessForm())
$formproc->RedirectToURL("index.php?content=thankyou");
}
ob_flush();
echo '<link rel="STYLESHEET" type="text/css" href="css/contact.css" />
<script type="text/javascript" src="scripts/gen_validatorv31.js"></script>';
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Sigal Zahavi - <?php echo $title; ?></title>
<link href="css/mainStyle.css" rel="stylesheet" type="text/css" media="screen"/>
<link href="css/thickbox.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="SHORTCUT ICON" href="http://www.breadandcoffee.co.za/sigalz.co.za/favicon.ico">
<script type="text/javascript" src="scripts/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="scripts/thickbox.js"></script>
<meta name="google-site-verification" content="-ZyDRU7n4zpulcMAoY-qmt-1TFYtubDKuBMTndH62j0" />
</head>
<body>
<?php $offline = FALSE; ?>
<div id="wrapper">
<div id="header">
<div id="pageTitle"><?php echo $title; ?></div>
</div><!-- End header -->
<?php
if(!$offline) include("content/nav.inc.php");
echo "<div id=\"" . $style . "\">";
include($nextPage);
echo "</div>";
?>
</div><!-- End wrapper -->
</body>
</html>
cgull 25 Light Poster
Hello,
I have downloaded a jquery gallery and made a lot of changes to it.
Now I am stuck with one thing that I can't change.
The gallery has thumbnails that scorll on the bottom.
I want the direction of the big image animation to change.
It is hard to explain, but if you go to this page:
http://www.ruthrudin.co.il/index.php?page=gallery&catId=1&catDir=magazines
You first stand on the first thumbnail on the right, when you click on the second one from the right, I want the big image to scroll from right to left and not from left to right. Then when you click again on the first thumb on the right, I want the big image to scroll from left to right and not from right to left.
The jQuery code is:
(function($) {
$.fn.adGallery = function(options) {
var defaults = { loader_image: 'images/gallery/loader.gif',
start_at_index: 0,
description_wrapper: $('#descriptions'),
thumb_opacity: 0.7,
animate_first_image: false,
animation_speed: 400,
width: false,
height: false,
display_next_and_prev: true,
display_back_and_forward: true,
scroll_jump: 0, // If 0, it jumps the width of the container
slideshow: {
enable: true,
autostart: false,
speed: 5000,
start_label: 'Start',
stop_label: 'Stop',
stop_on_scroll: true,
countdown_prefix: '(',
countdown_sufix: ')',
onStart: false,
onStop: false
},
effect: 'slide-hori', // or 'slide-vert', 'fade', or 'resize', 'none'
enable_keyboard_move: true,
cycle: true,
callbacks: {
init: false,
afterImageVisible: false,
beforeImageVisible: false
}
};
var settings = $.extend(false, defaults, options);
if(options && options.slideshow) {
settings.slideshow = $.extend(false, defaults.slideshow, options.slideshow);
};
if(!settings.slideshow.enable) {
settings.slideshow.autostart = false;
}; …
cgull 25 Light Poster
Hello,
I have a database where I insert records into, in Hebrew.
One of the fields needs to have quotes in it.
Then I need to use this field as the title attribute in an image tag.
I got confused with all the different functions: mysql_real_escape_string, addslashes, stripslashes etc.
Up to now I have inserted records into the table in phpMyAdmin.
I tried with slashes like: \"רכב\" and with & like: &רכב& and like that: "רכב"
Whatever I've tried, the code breaks.
For example, it shows only the slash from the title, or the title without any slashes, or nothing etc.
My code for reading:
$result = $con->query("select * from slides where cat_id = $catId and slide_id=1 order by cat_id, slide_id DESC");
while($row = $con->fetchArray($result))
{
$imgId = $row->slide_id;
$title = $row->slide_title;
$alt = $row->slide_alt;
if($imgId < 10)
$imgId = '00' . $imgId;
else
$imgId = '0' . $imgId;
$img = $imgId . '.jpg';
$tUrl = $url . "/thumbs";
echo "
<li>
<a href=\"$url/$img\">
[B]<img src=\"$tUrl/$img\" class=\"image0\" title=\"$title\" alt=\"$alt\" />[/B]
</a>
</li>
";
}
I also tried this code:
echo <<<LIST
<li>
<a href="$url/$img">
[B]<img src="$tUrl/$img" class="image0" title="$title" alt="$alt" />[/B]
</a>
</li>
LIST;
}
Can someone help me and tell me how to insert the record to the database and how to read it?
Thank you very much.
cgull 25 Light Poster
Hello,
Does anyone know about a good tutorial for a user login system?
I searched the net for a day and a half now, downloaded few scripts, tutorials and classes, but each one had a problem in it.
I need a simple and secure user login script.
Any help?
Thanks
cgull 25 Light Poster
Thank you,
since it won't work without authentication then I don't see how I can use it.
I will try looking at PHPMailer or PEAR:Mail.
I just want to test my contact forms locally before uploading them into a live server.
Thanks
cgull 25 Light Poster
Which OS and web server ?
sorry, using Windows 7 and Wamp 2
cgull 25 Light Poster
Hello,
Does anyone know how can I setup an email server on my local machine, with google or my host's server?
Or do you know of any site that explains how to do that?
Thanks
cgull 25 Light Poster
As far as I understand, you have the word $username stored in your database?
Then it will print $username since it is just text.
You need the get the actual user name from the session.
Do I miss anything here?
cgull 25 Light Poster
I never used netbeans before, and was just looking at it a few days ago.
I am using Dreamweaver for all my work.
Can anyone please tell me what is the adventage of using Netbeans?
cgull 25 Light Poster
Thanks for sharing the solution :)