Search found 23 matches

by benoit1980
Fri Jun 03, 2016 12:49 pm
Forum: PHP coding => General
Topic: Stuck with Ajax and form processing in php over https
Replies: 1
Views: 494

Re: Stuck with Ajax and form processing in php over https

Ok Found the problem it seems that it is a conflict between my ajax call in js and another file in the template, if I remove the main.js, it works, with it, it wont. <script type="text/javascript"> $(document).ready(function() { $(document).on('submit', '#reg-form', function() { $.post('processform....
by benoit1980
Fri Jun 03, 2016 11:41 am
Forum: PHP coding => General
Topic: Stuck with Ajax and form processing in php over https
Replies: 1
Views: 494

Stuck with Ajax and form processing in php over https

Hello, I have been on it for hours without any solution, I am really stuck. I have a form which I would like to submit using ajax and php as the processor but when I click on submit, I keep getting this error: contact-us.php:125 Uncaught TypeError: Cannot read property 'ajax' of undefinedsubmitForm ...
by benoit1980
Tue May 31, 2016 11:12 pm
Forum: PHP coding => General
Topic: Set current link to "active class" from navbar
Replies: 4
Views: 1021

Re: Set current link to "active class" from navbar

Thanks, good trick, I will use your technique from now on:-)
by benoit1980
Tue May 31, 2016 12:07 am
Forum: PHP coding => General
Topic: Set current link to "active class" from navbar
Replies: 4
Views: 1021

Re: Set current link to "active class" from navbar

Thank you Hyper,

I tried it but the <li> stays as "blank" no classes are being added.
It looks like the "basename($_SERVER['PHP_SELF']);" is not working in the way it should,
I tried to echo $current_file_name but nothing shows up.
by benoit1980
Fri May 27, 2016 7:14 am
Forum: PHP coding => General
Topic: Set current link to "active class" from navbar
Replies: 4
Views: 1021

Set current link to "active class" from navbar

Hello, I am having a hard time trying to find a solution that works. I just need to pass the active class to the current clicked <li> so the links changes color in my navbar My current code is: <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav side-nav"> <li <?=ech...
by benoit1980
Wed May 18, 2016 2:08 am
Forum: PHP coding => General
Topic: While Loop not working when calling within a function
Replies: 2
Views: 544

While Loop not working when calling within a function

Hello, I would really like to know why my while look is not calling any variable on my page when used within a function but works when the code in the function itself is on the page. function home_page_show_on_index(){ $query = query("SELECT * FROM home_page WHERE page_id = 1"); confirm($query); whi...
by benoit1980
Thu May 12, 2016 1:27 pm
Forum: PHP coding => General
Topic: Show dropdown menu based on the selection of another
Replies: 6
Views: 1018

Re: Show dropdown menu based on the selection of another

Now my next problem is that it works when changing the dropdown menu on the page but does not work if the dropdown menu is already selected on page load......

Any idea how to keep the settings on page load please?

Thank you.
by benoit1980
Thu May 12, 2016 1:25 pm
Forum: PHP coding => General
Topic: Updating 2 tables innodb using transactions
Replies: 1
Views: 572

Re: Updating 2 tables innodb using transactions

Ok Sorted, I have used this method $sql = "UPDATE users AS t1 JOIN models_addons AS t2 ON (t1.id = t2.users_id) SET t1.first_name = '{$firstname}', t1.last_name = '{$lastname}', t1.username = '{$username}', t1.email = '{$email}', t1.password = '{$password}', t1.role = '{$roles}', t1.categories_id = ...
by benoit1980
Thu May 12, 2016 12:45 pm
Forum: PHP coding => General
Topic: Updating 2 tables innodb using transactions
Replies: 1
Views: 572

Updating 2 tables innodb using transactions

Hello, I have never used transactions before and would like to know if this type of writing is allowed please, I am having a hard time troubleshooting this query....but perhaps I just cannot write it like that...just need some advice please. thanks. mysqli_autocommit($connection,FALSE); $a = mysqli_...
by benoit1980
Thu May 12, 2016 9:26 am
Forum: PHP coding => General
Topic: Show dropdown menu based on the selection of another
Replies: 6
Views: 1018

Re: Show dropdown menu based on the selection of another

Hi,

Yes you are absolutely right, my code was right, the problem came from jquery being loaded in the footer rather than the header:-)

Thanks again!
by benoit1980
Wed May 11, 2016 5:42 am
Forum: PHP coding => General
Topic: Show dropdown menu based on the selection of another
Replies: 6
Views: 1018

Re: Show dropdown menu based on the selection of another

Hi Nigelren, Thank you for the reply. I tried this code but cannot get my second dropdown to show up, it is weird. <script> $(document).ready(function(e) { $('#categories_id').change(function() { if ($(this).val() == '1') { $('.show-hide').show(); } else { $('.show-hide').hide(); } }); }); </script>...
by benoit1980
Wed May 11, 2016 3:13 am
Forum: JavaScript
Topic: Add and remove <li> with jquery
Replies: 1
Views: 5096

Add and remove <li> with jquery

Hello, I am trying to add and remove <li> with jqeury, the "add" function works but not the remove. When I click on the "remove" button it just disappears, Any idea why please? <h1 id="title">title</h1> <ul> <li>List 1</li> <li>List 2</li> <li>List 3</li> <li>List 4</li> <li>List 5</li> </ul> <input...
by benoit1980
Wed May 11, 2016 1:23 am
Forum: PHP coding => General
Topic: Easier way to hide empty value from database in Delimeter
Replies: 2
Views: 631

Re: Easier way to hide empty value from database in Delimeter

Thank you for the reply, So you mean something like that: function admin_show_users(){ $user_profile_picture = ""; $query = query("SELECT * FROM users"); confirm($query); while($row = fetch_array($query)){ $user_profile_picture = $row['user_profile_picture']; if(!empty($user_profile_picture)) { $sho...
by benoit1980
Wed May 11, 2016 1:18 am
Forum: PHP coding => General
Topic: Show dropdown menu based on the selection of another
Replies: 6
Views: 1018

Show dropdown menu based on the selection of another

Hello, I have a dropdown menu with 6 choices, out of those 6 choices, only one of them should trigger a secondary dropdown menu to show up. So here is my question, I see a lot of examples about people using ajax and other types of coding techniques to show up a secondary dropdown menu, would it be o...
by benoit1980
Tue May 10, 2016 9:42 am
Forum: PHP coding => General
Topic: Easier way to hide empty value from database in Delimeter
Replies: 2
Views: 631

Easier way to hide empty value from database in Delimeter

Hello, I have this function function admin_show_users(){ $user_profile_picture = ""; $query = query("SELECT * FROM users"); confirm($query); while($row = fetch_array($query)){ $user_profile_picture = $row['user_profile_picture']; if(!empty($user_profile_picture)) { $user_profile_picture; } $users = ...
by benoit1980
Tue May 10, 2016 4:36 am
Forum: PHP coding => General
Topic: Logout causing http 500 error
Replies: 3
Views: 1151

Re: Logout causing http 500 error

Thanks for your help. I have actually found what happened, because I am loading part templates in the layout, there was a time where the config.php at the top of the page was missing and this one included the session_start() + a redirect path file.

Thanks again!
by benoit1980
Tue May 10, 2016 4:11 am
Forum: PHP coding => General
Topic: Logout causing http 500 error
Replies: 3
Views: 1151

Re: Logout causing http 500 error

I also tried this but I am getting the same error:

Code: Select all

<?php
	session_start();
    session_destroy();

	if(isset($_COOKIE["email"])) {

		unset($_COOKIE["email"]);

        redirect("login.php");

	}else{
       redirect("login.php");
  
    }

?>
by benoit1980
Tue May 10, 2016 3:53 am
Forum: PHP coding => General
Topic: Logout causing http 500 error
Replies: 3
Views: 1151

Logout causing http 500 error

Hello, I am a bit lost on this one to be honest. I have this function: if(md5($password) === $db_password) { if($remember == "on") { setcookie('email', $email, time() + 86400); } $_SESSION['email'] = $email; This is part of my login process, as you can see both a session and a cookie are created(onl...
by benoit1980
Sat May 07, 2016 12:41 pm
Forum: PHP coding => Images
Topic: Need a bit of a checking on this code please
Replies: 6
Views: 2506

Re: Need a bit of a checking on this code please

Thank you for the reply but what would take the most space? To save the image as a string in the database or upload it as an image and save it´s path + name?

Thank you.
by benoit1980
Sat May 07, 2016 6:40 am
Forum: PHP coding => Images
Topic: Need a bit of a checking on this code please
Replies: 6
Views: 2506

Re: Need a bit of a checking on this code please

Thanks for the reply. I would like to ask you, I have seen functions on the internet where images are returned as a string, any idea why would someone do that? Is it actually possible to save an image as a string and reconvert it as an image? If this is the case then having a string should be far sm...
by benoit1980
Fri May 06, 2016 5:30 am
Forum: PHP coding => Images
Topic: Need a bit of a checking on this code please
Replies: 6
Views: 2506

Re: Need a bit of a checking on this code please

Well just noticed that the file name is written correctly in the database and the file is upload to the upload location correctly too but the image is still 2000px by 1000px.....
by benoit1980
Fri May 06, 2016 5:26 am
Forum: PHP coding => Images
Topic: Need a bit of a checking on this code please
Replies: 6
Views: 2506

Need a bit of a checking on this code please

Hello, My code is working as I have just tested it on my website, I need to resize a lot of images on my website and before I start implementing this all over, I would like to know if my code seems correct to you, I just need a little feedback to make sure I have coded it correctly please. I am stil...
by benoit1980
Wed Apr 27, 2016 12:23 pm
Forum: PHP coding => General
Topic: Folders below public_html is it right?
Replies: 1
Views: 596

Folders below public_html is it right?

Hello, I am building a little script where people will have to upload cv in pdf format of themselves for job seeking purposes. I am worried that people find the upload folder online and start to have access to all the cvs, Would it be right to have all the uploads send to below public_html? If yes, ...