-
Posts
49 -
Joined
-
Last visited
Everything posted by zazu
-
Hi guys, I have a huge problem with inserting multiple checked checkboxes into database and thene display checkones on frontend. In other word i have 2 problems regarding these checkboxes. 1. I have 3 checkboxes into user profile panel lets say checkbox 1, checkbox 2, etc. The user select the first 2 ones and inserts them into database. When he returns to his profile to edit his details, i want to display to the user those 2 checkbox that he selected earlier. 2. The secound problem i have is that i have a weekly calendar with week days and some hour intervals. For this the user must select the hours for a day when he is available and on his frontend profile to display them. This is another thing that i can't manage to do, and want a ideea. A print scrit of this calendar is attached to this message.
- 11 replies
-
- html checkbox
- checkbox
-
(and 1 more)
Tagged with:
-
Hi guys, I have 2 categories in my website one is CONTRY and the other one is TOWN. Now the non-friendly URL looks something like this: 1. mywebsite.com/country.php?url=clients-in-england (for country category) 2. mywebsite.com/town.php?url=clients-in-london (for town category) Now i want those nonfriendly url's to be something like this: 1. mywebsite.com/country/clients-in-england 2. mywebsite.com/town/clients-in-london How can i exactly do this using .htaccess I've tried something but not working. # redirect "/section.php?id=xxx" to "/section/xxx" RewriteCond %{REQUEST_URI} \s/town\.php\?url=([a-zA-Z0-9_-]+)\s [NC] RewriteRule ^ /town/%1? [R=301,L] # internally rewrite "/section/xxx" to "/section.php?id=xxx" RewriteRule ^oras/([a-zA-Z0-9_-]+)$ /town.php?url=$1 [L]
- 1 reply
-
- friendly url
- htaccess
-
(and 1 more)
Tagged with:
-
Now worked perfectly! It was my bad! Thank you very much.
- 12 replies
-
- calculate age
- data field
-
(and 1 more)
Tagged with:
-
Verify if the photo exists in database else show a default photo
zazu replied to zazu's topic in PHP Coding Help
<?php if ($result = $mysqli->query("SELECT profile_image FROM bonacuora_clients WHERE id='$id'")) { while($row = mysqli_fetch_array($result)) { echo "<img src='photos/" . $row['profile_image'] . "' class='media-object img-circle' width='180' height='180'>"; } } else { echo "default photo is?"; } ?> I;ve trying something like this, but it doesn't seems to work.- 3 replies
-
- database photo
- photo in database
-
(and 2 more)
Tagged with:
-
Hi guys, I've inserted in my database and folder a specific photo for profile. Now i want to verify if the photo is added in database and if it is display it, and if is not display a default photo. The code that i've used to show the photo is below, now i can't manage to do the secound part, wich is to display a default photo if there is none in database. <?php if ($result = $mysqli->query("SELECT profile_image FROM bonacuora_clients WHERE id='$id'")) { while($row = mysqli_fetch_array($result)) { echo "<img src='photos/" . $row['profile_image'] . "' class='media-object img-circle' width='180' height='180'>"; } } ?> Any suggestion?
- 3 replies
-
- database photo
- photo in database
-
(and 2 more)
Tagged with:
-
Hei Barad, thank you for your reply. The code that you provide in returns me 0 value insted of the age of the user.
- 12 replies
-
- calculate age
- data field
-
(and 1 more)
Tagged with:
-
And how the final code should look like?
- 12 replies
-
- calculate age
- data field
-
(and 1 more)
Tagged with:
-
Understand, but i want to get the birthday values from database not to specifiy them manually.
- 12 replies
-
- calculate age
- data field
-
(and 1 more)
Tagged with:
-
I use mysql and the date type is 1989-06-03
- 12 replies
-
- calculate age
- data field
-
(and 1 more)
Tagged with:
-
It is a date type
- 12 replies
-
- calculate age
- data field
-
(and 1 more)
Tagged with:
-
Hi guys, I'me trying to get the age of a user that i have in my database based on the data type field in database. So in my database in tha data field i have 20.02.1989 Now i want to display the age of the user with a specific ID, i must mention that i want to display the age of all users that will be register in the database. How can i do that because i've tried a lot of things and not of them seems to be working. My code is below: $dateValue = "SELECT EXTRACT(YEAR FROM data_nasterii) FROM bonacuora_clients WHERE id='$id'"; $c=date('Y'); $varsta = $c-$dateValue; Thank you!
- 12 replies
-
- calculate age
- data field
-
(and 1 more)
Tagged with:
-
Hi thx for help, i've solved my problem. The modified code is below: // General ////////////////////////////////////////////////////////////////////////////////////// $locality_utilitati_general = get_post_meta($post->ID, 'locality_utilitati_general', 0); if(!empty($locality_utilitati_general)) { ?> <?php _e('General: ','locality'); ?><?php echo implode(", ", $locality_utilitati_general); ?> <?php }
- 3 replies
-
- checkbox
- checkboxex
-
(and 2 more)
Tagged with:
-
Hi, thx for your answear, And what i should change in my code, because i tried to set from true to false and displays only array.
- 3 replies
-
- checkbox
- checkboxex
-
(and 2 more)
Tagged with:
-
Hi there guys, I've made some new checkbox fields in my wordpress template using Meta box. Now i want to display those selected checkboxes in the forntend, but it will display only the first checkbox that i've checked, not the other ones. The problem seems to by the array functions that displays only the first checkbox. I'll put bellow the codes that i've been using: This is the code from the meta-box-config.php // General ////////////////////////////////////////////////////////////////////////////////////// array( 'name' => 'Genearal', 'id' => "{$prefix}utilitati_general", 'clone' => false, 'type' => 'checkbox_list', 'options' => array( 'Curent Electric' => __('Curent electric','locality'), 'Telefon' => __('Telefon','locality'), 'Apa' => __('Apa','locality'), 'Gaz' => __('Gaz','locality'), 'Cablu TV' => __('Cablu TV','locality'), 'Canalizare' => __('Canalizare','locality') ), 'std' => false ), This is the code from the frontpage // General ////////////////////////////////////////////////////////////////////////////////////// $locality_utilitati_general = get_post_meta($post->ID, 'locality_utilitati_general', true); if(!empty($locality_utilitati_general)) { ?> <?php _e('General: ','locality'); ?><?php echo implode(',', $_POST['locality_utilitati_general']); ?> <?php }
- 3 replies
-
- checkbox
- checkboxex
-
(and 2 more)
Tagged with:
-
Hey, Yes, i've solved the problem with the exact solution that you offer and it works just fine. Thank you for your help.
-
Thanks man. I've already done that, and works very fine, but i don't like how it looks on page, and i tought that can be another solution to this. Thnak you for your answer.
-
Hi there guys, I wish if u can to help me solve a little problem. I upload my pictures into a folder on the server (website.com/uploads) using a upload script. Now i have a form with 3 fields (title, picture, and description) At the picture field my code looks like this: <label>Picture:</label> <input type="file" name="title" id="title" class="text-long" /> Now when i click on the browse button i want to select the picture that i've added in my upload folder insted of a file from the pc How can i do that? I'm waiting for your answers. Thank you very much!