I'm no too used to or familiar with the Joomla system. SO I kind of need your help here. Here's my problem.
I'm building a site, but the template came with problems and the template makers refuse to accept they made a mistake. AS Templates Don't buy from these guys unless you don't care about being on your own if something happens.
Anyway, basically, the site's buttons are all out of alignment. I tried fixing them through CSS but no luck. Some things can't be fixed in the CSS files because they belong to the HTML part of it. But as some of you may know, Joomla is PHP not HTML. So my question is how do I fix an HTML line of code in Joomla?
To be specific:
I have this code in my site
<form name="logoutForm" method="post" action="/">
<button class="btl-buttonsubmit"onclick="document.logoutForm.submit();" name="Submit" style="">Log out</button>
<input type="hidden" value="com_users" name="option">
<input type="hidden" value="user.logout" name="task">
<input type="hidden" value="aW5kZXgucGhwP0l0ZW1pZD0xMDE=" name="return">
<input type="hidden" value="1" name="7b6cc3e246acff3e3943410a6f4919cf">
</form>
Since this is not PHP code or CSS I cant find it anywhere
Here are the screenshots of my two trouble areas
and
Thanks again
I'm re-editing this to add the code for the search results. Please review for me, refer to the screenshot as well to see what I see or go to my site and search for anything
<?php
defined('_JEXEC') or die;
$lang = JFactory::getLanguage();
$upper_limit = $lang->getUpperLimitSearchWord();
JHtml::_('bootstrap.tooltip');
?>
<form id="searchForm" action="<?php echo JRoute::_('index.php?option=com_search');?>" method="post">
<div class="btn-toolbar">
<div class="btn-group pull-left">
<input type="text" name="searchword" placeholder="<?php echo JText::_('COM_SEARCH_SEARCH_KEYWORD'); ?>" id="search-searchword" size="30" maxlength="<?php echo $upper_limit; ?>" value="<?php echo $this->escape($this->origkeyword); ?>" class="inputbox" />
</div>
<div class="btn group pull-left">
<button name="Search" onclick="this.form.submit()" class="button btn btn hasTooltip" title="<?php echo JText::_('COM_SEARCH_SEARCH');?>"><span class="icon-search"></span></button>
</div>
<input type="hidden" name="task" value="search" />
<div class="clearfix"></div>
</div>
<div class="searchintro<?php echo $this->params->get('pageclass_sfx'); ?>">
<?php if (!empty($this->searchword)):?>
<p><?php echo JText::plural('COM_SEARCH_SEARCH_KEYWORD_N_RESULTS', '<span class="badge badge-info">'. $this->total. '</span>');?></p>
<?php endif;?>
</div>
<fieldset class="phrases">
<legend><?php echo JText::_('COM_SEARCH_FOR');?>
</legend>
<div class="phrases-box">
<?php echo $this->lists['searchphrase']; ?>
</div>
<div class="ordering-box">
<label for="ordering" class="ordering">
<?php echo JText::_('COM_SEARCH_ORDERING');?>
</label>
<?php echo $this->lists['ordering'];?>
</div>
</fieldset>
<?php if ($this->params->get('search_areas', 1)) : ?>
<fieldset class="only">
<legend><?php echo JText::_('COM_SEARCH_SEARCH_ONLY');?></legend>
<?php foreach ($this->searchareas['search'] as $val => $txt) :
$checked = is_array($this->searchareas['active']) && in_array($val, $this->searchareas['active']) ? 'checked="checked"' : '';
?>
<label for="area-<?php echo $val;?>" class="checkbox">
<input type="checkbox" name="areas[]" value="<?php echo $val;?>" id="area-<?php echo $val;?>" <?php echo $checked;?> >
<?php echo JText::_($txt); ?>
</label>
<?php endforeach; ?>
</fieldset>
<?php endif; ?>
<?php if ($this->total > 0) : ?>
<div class="form-limit">
<label for="limit">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<p class="counter">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
</form>
mmm yea I can see what you mean. The template does have some issues. And that is not only your problem there are many places were you need to edit your stylesheet. But it's very hard to eyeball all of them and wrap all the solutions in one answer.
But as an advice you can use firebug if you are using firefox or google developer tools by pressing ctrl shift j to open them. You can edit some of your content live and see the changes that are needed to be done in specific places and then you just do them.
For example I found at the section CONTACT the upper right banner has it title popping out of the template. The fix is located in /templates/as002035/css/tmpl.custom.css line 11 by setting the padding to 0 0 20px.
When Creating an account a modal box splashes into my face. You need to fix that by editing the width and the height of that window again by using those tools.
Finally i cant see the logout button " form " since I can't register to your website due to the mail that was not sent in my e-mails. So probably you need a developer to fix all of these things.
I hope I helped a bit.
Besides the (good) advice already provided, there is a missing answer to your question: where does the HTML markup come from?
You will find it in one of two places: first check your template overrides (which I think is the case looking at your question), which would be located in
/templates/as002035/html/com_users/login/default_logout.php (logout component)
/templates/as002035/html/mod_login/ (login|logout module)
if they are not present, then the default Joomla layouts are in
/components/com_users/views/...
/modules/mod_login/tmpl
Added after clarification below, this is the answer the the comments.
you're missing a class "button" so the line of the module should be:
<input type="submit" value="Log out" class="button btn btn-primary" name="Submit">
instead of
<input type="submit" value="Log out" class="btn btn-primary" name="Submit">
(see the added "button"?). Did you find the template ? is it in the overrides? if you can just make that change you'll get the module fixed. As for the component logout form, http://www.guhlmotors.com/index.php?option=com_users
<button class="button btn" type="submit">Log out</button>
instead of
<button class="button" type="submit">Log out</button>
Related
I am working on a project where we have a few items in the database that are displayed on a website and that works fine code is below:
<form method="post" action="store.php?action=add&ItemNo=<?php echo $products['ItemNo']; ?>">
<a href="product.php"><div class="products">
<img src="<?php echo $products['img'];?>" class="img-responsive"/>
<!-- this connects to the database and gets the image of item -->
<h4><?php echo $products['ItemName'];?></h4>
<h3>$ <?php echo $products['Price'];?></h3>
<input type="text" name="Quantity" class="form-control" value="1"/>
<!-- This creates an box where the default qnt is set to 1 -->
<input type="hidden" name="ItemName" value="<?php echo $products['ItemName']; ?>" />
<input type="hidden" name="Price" value="<?php echo $products['Price']; ?>" />
<input type="submit" name="addtocart" style="margin-top:5px;" class="btn btn-info"
value="Add to Cart"/>
<!-- this creates the btn that adds item to cart -->
</div>
</a>
</form>
Now I am trying to show more details about each product. All I want is when the user clicks any item they will be sent to item.php page where there will be more details about that specific item.
At this moment I got all info displaying in item.php and I am stuck.
I do not know how to word this question, maybe that is why I cannot find any help out on Google. I am new to PHP as I just started with it few weeks ago.
firstly
<a href="product.php?id=<?php echo $products['ItemNo']; ?>">
then on product.php check the url for $_GET['id'] and use that in your query.
SELECT * from foo where id=$id
but dont use the raw id or a non parametrised query unless you like being hacked
I apologise if this question has been asked, I have looked and can't find an answer that fits but if I'm wrong please tell me!
I've created a login form and when the user logs in they can see their Name, E-mail, Phone and Availability. At the moment this is just echoing / printing the information from the MySQL database. What I was wondering is how I make this editable so that the logged in user can update their own information?
Thanks an absolute bunch to everyone by the way, I'm new to this site and everyone has been extremely helpful. I'm not a developer by trade and very much learning as I go on this project so it is appreciated! :)
<?php
session_start();
$sessData = !empty($_SESSION['sessData'])?$_SESSION['sessData']:'';
if(!empty($sessData['status']['msg'])){
$statusMsg = $sessData['status']['msg'];
$statusMsgType = $sessData['status']['type'];
unset($_SESSION['sessData']['status']);
}
?>
<div class="container">
<?php
if(!empty($sessData['userLoggedIn']) && !empty($sessData['userID'])){
include 'user.php';
$user = new User();
$conditions['where'] = array(
'id' => $sessData['userID'],
);
$conditions['return_type'] = 'single';
$userData = $user->getRows($conditions);
?>
<h2>Welcome <?php echo $userData['first_name']; ?>!</h2>
Logout
<div class="regisFrm">
<p><b>Name: </b><?php echo $userData['first_name'].' '.$userData['last_name']; ?></p>
<p><b>Email: </b><?php echo $userData['email']; ?></p>
<p><b>Phone: </b><?php echo $userData['phone']; ?></p>
<p><b>Available: </b><?php echo $userData['available']; ?></p>
<li><a href=profile.php>Update Profile<a></li><br>
<form action="change.php" method="post">
Are you available this weekend?<br>
<input type="radio" name="available" value="yes"> Yes<br>
<input type="radio" name="available" value="no"> No<br>
<input type="submit" value="Submit">
</form>
</div>
<?php }else{ ?>
<h2>Login to Your Account</h2>
<?php echo !empty($statusMsg)?'<p class="'.$statusMsgType.'">'.$statusMsg.'</p>':''; ?>
<div class="regisFrm">
<form action="userAccount.php" method="post">
<input type="email" name="email" placeholder="EMAIL" required="">
<input type="password" name="password" placeholder="PASSWORD" required="">
<div class="send-button">
<input type="submit" name="loginSubmit" value="LOGIN">
</div>
</form>
<p>Don't have an account? Register</p>
</div>
<?php } ?>
</div>
I am a newbie to php programming as well, so I very well could be wrong. I apologize in advance if this doesn't work.
From what I understand of your question, why can't you make a form?
I was in a similar situation before, and I just made a form asking for their details they wish to change and a password field.
Transfer the data from the form to a .php file (using action='filename.php'), where you can make queries to update your mysql database.
Hope it helps.
This is a hopeful question. I am really, really PHP inexperienced. But I am trying to teach myself a thing or two. The organization I work for uses a WP site. I regularly work on it. I mostly do HTML and CSS (stuff I know about) but I was just digging around in the background and came across something I don't understand at all.
I made a test page here: http://all4ed.org/webinar-event/test-2/
There are two forms on the page. The first ends in a "submit button," the second ends in a "Register Button."
So far so good. I dug around the backend of the WP files, and found the content-webinar.php file and saw that it pulled the form in as an include with:
// The registration form. ?>
<?php if ($registration_required == 'yes'): ?>
<?php include ('assets/includes/webinar/inc-block-registration-form.php'); ?>
<?php endif;
Good, so far.
I went to the "inc-block-registration-form.php" file and here's where it gets weird:
The first form is done with this code:
<form class="webinar-registration" action="<?= $_SERVER["REQUEST_URI"] ?>" method="get">
<div>
<p>
<label for="token">Token</label>
<input type="text" name="token" />
</p>
<p>
<button>Submit</button>
</p>
</div>
</form>
This looks exactly like I thought it would. The second form is written like this:
<form class="webinar-registration" action="<?= $_SERVER["REQUEST_URI"] ?>" method="post">
<div>
<?php if ($webinars->error) : ?>
<p class="error"><?= $webinars->error ?></p>
<?php endif; ?>
<?php foreach ($webinars->form_data as $data) : ?>
<p><?= $webinars->build($data) ?></p>
<?php endforeach; ?>
<p>
<button>Register</button>
<input type="hidden" name="webinars_registration_submitted" value="<?= $post->ID ?>" />
<input type="hidden" name="webinars_registration_title" value="<?= get_the_title() ?>" />
<input type="hidden" name="webinars_registration_url" value="<?= get_permalink() ?>" />
<!-- fields necessary for AA -->
<input type="hidden" name="webinars_user_id" value="<?= get_current_user_id() ?>" />
<input type="hidden" name="webinars_type" value="<?= get_field('webinar_type') ?>" />
<input type="hidden" name="webinars_post_id" value="<?= get_the_ID () ?>" />
</p>
</div>
</form>
Huh???? Where is the "Your Name", "Your E-mmail Address," "Organization," "City, State," or "Question (This is optional)"
How does this work? Where is it pulling those fields from. Any insight would be appreciated. Thanks.
I have the following Form code:
<form method=post action='/zoeken.php'>
<div style='position: relative;'>
<input type=search name=zoeken_opdracht placeholder='Zoeken...' value="<?php echo $_POST['zoeken_opdracht']; ?>">
<button name=zoeken><i class='fa fa-search'></i></button>
</div>
</form>
However, when I am submitting in on specific pages, it isn't submitting. The same code however works fine on all other pages (No product pages).
See examples of productpage here:
Productpage (Form not working)
You can find the other forms on any other page but the productpages. For instance the homepage.
Change button with submit
Careful that there are errors in the type search, in the form method, in some name and style
<form method="post" action="/zoeken.php">
<div style="position:relative;">
<input type="search" name="zoeken_opdracht" placeholder="Zoeken..." value="<?php echo $_POST['zoeken_opdracht']; ?>">
<input type="submit" name="zoeken"><i class="fa fa-search"></i>
</div>
</form>
<form method=post action='/zoeken.php'>
<div style='position: relative;'>
<input type="search" name="zoeken_opdracht" placeholder='Zoeken...' value="<?= $_POST['zoeken_opdracht']; ?>">
<button type="submit" name=zoeken><i class='fa fa-search'></i></button>
</div>
</form>
The problem is solved. I figured out that there was a preventDefault in my javascript code that was also triggered on the search form submission. I fixed this and now it works like a charm.
Thanks for the
I am new to PHP and I am trying to get information from a form to another page, but the data won't transfer over when I hit submit. What am I doing wrong? Should I be trying to use GET instead of POST? What is the best way to debug something like this?
The path to information.php is definitely correct.
<form action="information.php" method="post" type="post">
<div class="row" style="padding-bottom: 20px;">
<label name="tempID"><?php echo $number; ?></label>
<button class="btn" name="submit" type="submit">More Details</button>
</div>
</form>
This file is in a different page (information.php)
if (isset($_POST["tempID"]))
{
$infoID = $_POST['tempID'];
}
echo $infoID;
<input type="hidden" name="tempID" value="<?php echo $number; ?>" />
Add this next to your original echo, post variables can't be stored in a label. Also remove the name value from the label
You need a submit input instead of a button with the name submit. Change the button's html to:
<input type='submit' value='More Details'>
Change Label in input
<form action="information.php" method="post">
<div class="row" style="padding-bottom: 20px;">
<input name="tempID" value="<?php echo htmlentities($number); ?>"/>
<button class="btn" name="submit" type="submit">More Details</button>
</div>
</form>
labels are only to display information. they are not submitted during form submission.
<form action="information.php" method="post" type="post">
<div class="row" style="padding-bottom: 20px;">
<label>Number:</label>
<input name="tempID" value="<?php echo $number; ?>"/>
<input class="btn" id="submit" name="submit" type="submit" value="More Detail" />
</div>
</form>