cleop87
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to enter PHP code for accessing mySQL database tablesThanks Chris.
Per your suggestion the link has been removed. That in itself was a great help securety-wise.
I do use the internet extensively and have viewed several you-tube tutorials on php. That’s how I created the connection file. Based upon your suggestions it seems that for me, the next step is to read and learn more on how to create the function, retrieve the data and populate my web page with the information. That’s what I was hoping to learn in more detail from this forum. I thought my question was simple but apparently it’s not.
The exec-php plugin, which was suggested from another contributor on this forum, allows me to enter php code within the html content portion of the page that I’m editing. I just reached the point where I need to call the one function on various pages without having to enter the function code on each and every page. It seems I’ve perhaps gotten ahead of myself and will return to the php online manual to try to get an answer. If anyone else has had a similar need, and found the solution, I would sincerely appreciate any suggestions.
Kindest regards,
Cleop87Forum: Fixing WordPress
In reply to: How to enter PHP code for accessing mySQL database tablesI’ll go ahead and thank you now. Thx for your input and I sincerely appreciate it.
Being a 100% disabled vet I have the time but not the money. I know how to create the code to connect to the database. I’ve created a php file to do just that and it works. I put my various php files, that I use for testing, in a folder within the public_html directory and named it “test-php-files.” The php connection file that I created to connect to the database is named “connectionfile.php.” If you go to your browser and enter the url (http://giftsrus.org/test-php-files/connectionfile.php) you will see the following text that I created to let me know that I have, in fact, connected to my database which is hosted by Hostgator:
“If there are no errors in connecting to the database this is the only line you should see.:-)”
My first question is where do I enter the php code for connecting to my database within my WordPress theme? My WordPress theme is “A Simple Love,” which is a child theme of the “Thematic” theme. I don’t know whether to enter the code into my individual page content (a separate divisioin within the html code for that page), my CSS stylesheet (or create another CSS stylesheet), create a new php file within “Appearance > Editor>Edit Theme, create a separate template and include it in the TEMPLATE php files on the far right column.
I’m no expert but I do feel somewhat comfortable working with html and CSS. I’m simply trying to find out where I enter the PHP code/file to access my database without having to enter the URL as shown above.
Again, thank you very much.
Forum: Fixing WordPress
In reply to: How to enter PHP code for accessing mySQL database tablesThx again. Pls pardon my confusion. I’m still struggling and I have installed the “exec-PHP” plugin for WordPress. It allows me to enter php code within the page content area. If there is another plugin you would recommend, please let me know.
Now I can go to my web browser and enter the url (http://www.giftsrus.org/writeName.php) and I get “You have now connected to the writeName.php file SUCCESSFULLY!” (this is the test function that I created and it tells me that I have the php file executed properly within the page). However, I need to call that same function in multiple pages. So, where do I create that function (within the styleshee, create a new php template, or…..) and how do I call that function from other pages?
Since the function will be used in multiple pages I’m trying to avoid having to write the same function in each and every page where it’s needed. Is this possible? Any ideas on how I can accomplish this would be greatly appreciated. I feel so close and yet so far away.
This is the code for the “writeName.php file” and it is stored in the “public_html” directory along with the wp-content directory:
<?php
function writeName()
{
echo “SUCCESSFULLY!”;
}
echo “You have now connected to the writeName.php file “;
writeName();
?>Forum: Fixing WordPress
In reply to: How to enter PHP code for accessing mySQL database tablesThanks again so very much.
I uploaded the php file (writeName.php) into the “public_html” directory and yes, I can now enter the url (giftsru.org/writeName.php) and it will display successfully. Yeah !So, when someone goes to my web page he/she will see products that show the image, “up-to-date” price of the product, description, etc — all of which are derived from the vendor’s daily datafeed. I upload the datafeeds to my database/SQL table via ftp (Hostgator).
When the visitor visits my web site and clicks on the product it should take them to another page/url or a page within my site. I’m assuming they’re not going to be typing in “giftsrus.org/writeName.php.
* I can create the PHP function but where do I store that function?
* When I create a PHP script to connect to my database and my database table, where do I put that script; on the web page itself, within my style sheet, within my theme, or ???.
* I know I need to connect to my database, and SELECT the data within my database table. Where do I enter the code to do so.
I think we’re getting closer to the resolution and sincerely appreciate your help. I’ve read tons of stuff on this an have spent hours and hours searching but am clearly missing something.
Thx again.
Cleop87Forum: Fixing WordPress
In reply to: How to enter PHP code for accessing mySQL database tablesThanks for the quick response.
I can create the php file but don’t know where to upload that file and don’t know where the file should be located within my directory structure in order for the file to be actually executed.My steps are as follows:
1. I log in to ‘Filezilla’ and can see my remote site (Hostgator) and the directory structure, folders, files, etc.2. I begin by looking at my remote site and scroll down to the “public_html” directory
3. Within the “public_html” directory I created a file folder named “test-php-files.” In this folder I create php files to test my coding. In this case the file is named “connectionfile.php”. It is used to show that I have successfully connected to my database. It works, sort of, but I have to enter the complete URL to get that file to execute. An end-user wouldn’t know this therefor it would not work properly.
Please note: Also within the “public_html” directory lies the “wp-content” folder which holds my theme, plugins, & upgrade folders as well as the “index.php” file.
When you copy the complete url of the /connectionfile it is as follows:
ftp://*****@giftsrus.org/public_html/test-php-filesconnectionfile.php (I replaced sensitive data with the ********).However, to test the connectionfile.php you can’t enter this url as it is above. You need to get rid of the:
ftp://********@giftsrus.org/public_html within the url and change the url to:
• http://giftsrus.org/test-php-files/connectionfile.phpThe problem is that I don’t know where to put PHP files – in public_html (which clearly doesn’t work), wp-content, wp-admin, etc.
The whole point of this is that I want to place products on my web site that shows the current prices and when the prices change (as shown in datafeeds), I want to have those new/current prices changed and displayed on my web page.
Thanks again,
Cleop87Forum: Fixing WordPress
In reply to: How to enter PHP code for accessing mySQL database tablesThanks for the quick response.
I can create the php file but don’t know where to upload that file and don’t know where the file should be located within my directory structure in order for the file to be actually executed.My steps are as follows:
1. I log in to ‘Filezilla’ and can see my remote site (Hostgator) and the directory structure, folders, files, etc.2. I begin by looking at my remote site and scroll down to the “public_html” directory
3. Within the “public_html” directory I created a file folder named “test-php-files.” In this folder I create php files to test my coding. In this case the file is named “connectionfile.php”. It is used to show that I have successfully connected to my database. It works, sort of, but I have to enter the complete URL to get that file to execute. An end-user wouldn’t know this therefor it would not work properly.
Please note: Also within the “public_html” directory lies the “wp-content” folder which holds my theme, plugins, & upgrade folders as well as the “index.php” file.
When you copy the complete url of the /connectionfile it is as follows:
ftp://*****@giftsrus.org/public_html/test-php-filesconnectionfile.php (I replaced sensitive data with the ********).However, to test the connectionfile.php you can’t enter this url as it is above. You need to get rid of the:
ftp://********@giftsrus.org/public_html within the url and change the url to:
• http://giftsrus.org/test-php-files/connectionfile.phpThe problem is that I don’t know where to put PHP files – in public_html (which clearly doesn’t work), wp-content, wp-admin, etc.
The whole point of this is that I want to place products on my web site that shows the current prices and when the prices change (as shown in datafeeds), I want to have those new/current prices changed and displayed on my web page.
Thanks again,
Cleop87Forum: Fixing WordPress
In reply to: jQuery – How to test a jQuery scriptStill trying to get this to work; not successful.
Using WP version 3.3.1.
Theme = “a-simple-love (thematic child themeI’ve seen this tip from the WP forum and added it to my function.php file:
<?php
wp_enqueue_script(‘jquery’);
wp_enqueue_script(‘jquery-ui-core’);
wp_enqueue_script( ‘onLoad’, ‘/wp-content/themes/my-theme/js/onLoad.js’, array( ‘jquery’ ) );
?>I deactivated my “Use Google Libraries” plugin. It wasn’t working either – unless it was entered in the page via the new page in the dashboard.
So I’m back to hard-coding in the functions.php file and the header.php file. In the header.php file I’ve entered (before the “wp_head ();” code). I’ve worked weeks on this to no avail.
This is the src code when using the “Use Google Libraries” plugin. Should this be entered some place?
<script type=’text/javascript’ src=’http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js’></script>
Still not working. Any help Please.
Forum: Fixing WordPress
In reply to: jQuery – How to test a jQuery scriptHi kostas123,
Thanks a bunch for your quick reply. I don’t know how to use “DOMs” so I’ll have to add that to my to-do list. I’m following your suggestion and looking at the libraries.
Again, thanks for the tips – every little bit helps.
Kindest regards,
cleop87Forum: Fixing WordPress
In reply to: jQuery – How to test a jQuery scriptHello Abinav,
Thank you so very much for the quick reply. I followed your suggestion and read the link article. It was quite helpful.
Then I installed and activated the plugin “Use Google Libraries.” I can now see this code in the head profile via Mozilla Firefox:
<script type=’text/javascript’ src=’http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js’></script>
To test whether or not it works, I’ve created a new text page and entered the following code(within the page template):
<script type=’text/javascript’ src=’http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js’></script>
<script type=”text/javascript”>
$(document).ready(function(){
$(“button”).click(function(){
$(“p”).hide();
});
});
</script><h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<p>When you click on the “Click Me” button it should hide these 3 paragraphs and show only the “Heading.”
<button>Click me</button>Amazingly, it worked like a champ; but Since you mentioned that we should not enter the code within the page template, where should the “java scripts” be entered? I fought with it this weekend but could only get it to work within the page template.
Any suggestions would be greatly appreciated. Thanks again for your help.
Kindest regards,
Cleop87Forum: Fixing WordPress
In reply to: Dropdown Menu goes behind the Page TitleThx orpatech.com.
I’ve increseed the z-index via the “editor” in the “Appearance” section. I’m using “A Simple Love” theme which is the child theme for Thematic. It uses the SuperFish (sf.menu). The “menu” portion in the editor looks like this:
.sf-menu,.sf-menu * {
list-style : none;
margin : 0;
padding : 0;
}
.sf-menu {
line-height : 13px;
}
.sf-menu ul {
position : absolute;
top: -999em;
width : 16em;
}
.sf-menu ul li {
width : 100%;
postition : relative;
z-index : 100;
}
.sf-menu li:hover {
visibility : inherit;
}
.sf-menu li {
float : left;
position : relative;
}
.sf-menu a {
display : block;
position : relative;
}
.sf-menu li:hover ul,.sf-menu li.sfHover ul {
left : 0;
top : 12px;
}
ul.sf-menu li:hover li ul,ul.sf-menu li.sfHover li ul {
top : -999em;
}
ul.sf-menu li li:hover ul,ul.sf-menu li li.sfHover ul {
left : 16em;
top : 0;
}
ul.sf-menu li li:hover li ul,ul.sf-menu li li.sfHover li ul {
top : -999em;
}
ul.sf-menu li li li:hover ul,ul.sf-menu li li li.sfHover ul {
left : 16em;
top : 0;
}
.sf-menu a {
font-family : Helvetica,Arial,Verdana,sans-serif;
padding : 9px 20px;
text-decoration : none;
text-transform : uppercase;
}
.sf-menu a,.sf-menu a:visited {
color : #666;
}
.sf-menu li:hover,.sf-menu li.sfHover,.sf-menu a:focus,.sf-menu a:hover,.sf-menu a:active {
background : #f0f0f0;
outline : 0;
}
.sf-menu ul {
border-bottom : 1px solid #96d1e2;
border-left : 1px solid #96d1e2;
border-right : 1px solid #96d1e2;
}
.sf-menu li:hover ul,.sf-menu li.sfHover ul {
top : 31px;
}
.sf-menu ul ul {
margin-top : 0;
}
.sf-menu ul a {
background : #f0f0f0;
border-bottom : 1px solid #fff;
border-bottom : none;
border-right : 1px solid #fff;
}
.sf-menu ul a:hover {
border-bottom : 1px solid #fff;
border-right : 1px solid #fff;
color : #FF4B33;
}I’ve tried increasing the z-index in various portions of the menu so many time I’m not sure which ones I’ve changed. I know I should have kept better notes. Any suggestions would be appreciated.
Thx,
cleop87Forum: Fixing WordPress
In reply to: Dropdown Menu goes behind the Page TitleHi vtxyzzy,
I’m using the “A Simple Love” childtheme for the “Thematic” theme.
The child theme has a row of buttons (page links) at the top of the page (e.g. HOME, HALLOWEEN COSTUMES & ACCESSORIES, CAMERAS & VIDEO, etc.). Please go to the HALLOWEEN COSTUMES & ACCESSORIES page. I ask this because the title is longer. Once you’re on that page, hover over the HALLOWEEN COSTUMES & ACCESSORIES button at the top to display the dropdown menu. The dropdown menu will show the various “child” pages and you will see that the dropdown menu items will go behind the “Page Title.”(HAALOWEEN COSTUMES & ACCESSORIES).
I could shorten the title but that would only be a temporary fix and I’d like to know how to change whatever code I need to change to make it a permanent fix. Any suggestions would be appreciated.
cleop87