your db connection doesnt contain a password
your db connection doesnt contain a password
i try my best but fail,,,
What is the issue? Are you getting an error?
JayJ, have you tried using return
on the variable you want to pass out?
You need to include session_start()
at the top of loginproc.php
// get simple_html_dom from http://simplehtmldom.sourceforge.net/
include_once('simple_html_dom.php');
// Add url in place of "URL"
$result = file_get_html(URL);
// Searchs for 'a' tags
$result_a = $result->find('a');
// Replace 'http://'
foreach($result_a as $resultA){
echo str_replace('http://','',$resultA);
}
// Show untouched
foreach($result_a as $resultA){
echo $resultA . "<br/>";
}
Should do it for you
sorry i dont want to say form it is from :)
Lol, no probs.
This is one that i have done.
http://www.daniweb.com/web-development/php/threads/434041/scrap-which-removes
Which should help.
$result = file_get_html('http://www.example.com/');
foreach($result->find('a') as $element){
$result = str_replace('http://', '', $result);
}
foreach($result->find('a') as $elementa){
echo $element->href;
echo $elementa->href;
}
As i edited in (may have been as you were replying), str_get_html
is used for loading in strings.
Try the above.
Also this is not a form
it is form
$html = file_get_html('http://www.example.com');
$result = $html;
From where are you populating $result
from?
As per the documentation around Simple HTML DOM, str_get_html is for loading a string.
Put your foreach loops in {}
$result = str_get_html($result);
foreach($result->find('a') as $element){
$result = str_get_html($result);
$result = str_replace('http://', '', $result);
}
foreach($result->find('a') as $elementa){
echo $element->href;
echo $elementa->href;
}
Diafol many thanks. Working like a charm
@LastMitch
I want to get ride of them although they look to be embedded:
This is an example of the scrape:
supports Coreâ„¢ 2 Duo/Coreâ„¢ 2 Duo LV Processor F
This should read:
supports Core 2 Duo/Core 2 Duo LV Processor F
hi all,
I have a scrap working but it also brings the restred trade mark.
I have permission from the company to do this.
How do i strip these out?
// get simple_html_dom from http://simplehtmldom.sourceforge.net/
include_once('simple_html_dom.php');
// @todo change $url for form input
$url = "";
$html = file_get_html($url);
// look for ul tags inside DIV with id ProductDetail
$ul = $html->find('div[id=ProductDetail] ul');
// look for h1 tags inside DIV with id ProductDetail
$h1 = $html->find('div[id=ProductDetail] h1');
// look for span tag with discription class inside DIV with id ProductDetail
$det = $html->find('div[id=ProductDetail] span[class=discription]');
foreach($h1 as $header1){
echo $header1 ."<br/>";
}
foreach($det as $detail){
echo $detail . "<br/>";
}
foreach($ul as $list){
echo $list . "<br/>";
}
@furianera;
Could you post your code? I am in need of a scrape that deals with multiple tags
@andyy121
@LastMitch aahhahhahahahaha you are such a big fail the problem wasnt in SELECT ect ect
Good Luck, I don't know what else to say.THIS IS FOR YOUUUUUUUUUUUUUUUU
And that is how you treat people who try and help. Mate you are a sad person. Shooting people down that try and help. Good luck with your coding issues and trying to get help from people.
TWAT
hey plz i need help i told you if i know this thing i wouldn't be here if i would be rich i should lerning this thing in a college is so hard to help me ??
People have jobs!!!! I wipe my hands
f you wont its code i can send you
Yes
the problem is when i search a word in db from the php it must display that because it is in the db but it shows this:Your search for andi returned no results.
I dont see any SQL query to the database!! If you want to query a database you MUST have a query and connection.
"SELECT * FROM [TABLE_NAME] WHERE [TABLE_COLUMN] = '$keywords'"
Post your table structure.
Post your query.
NO ONE CAN READ MINDS
im asking just for help if i know how to do that i wasnt here spending my life with you.
Please put the code you have used to try and connect to the database, and your SQL string.
Then perhaps people can help. DB conection is very basic PHP and MySQL. Help us to help you.
POST YOUR CODE
so any answer or any ideas from you
I would suggest you use "GOOGLE" below is a link which is searched by looking for "PHP and MYSQL", this will go over basic db connection, unless you are using PDO, then google DB connection using PDO, or even use the search function on this forum.
@andyy121:
Quite frankly with the attitude you come on to the forum with i have given up caring.
People on here have help you and pointed you in viable directions, and yet you seem to think everyone on here owes you something.
If it was possible i would have you blocked from my profile, and considering how rude you were on the last thread, good ridence to you.
@Mods,
No offence intended to anyone on here, but this guys attitude sucks.
hey i have added this but it doen't display what i write in search field
if (isset($_POST['keywords'])){
$keywords = strip_tags(trim($_POST['keywords']));
echo $keywords; // remove the ''
}
This works for me with no problem
Error? Reason for posting? Although the $sql looks like it wont work is that correct?
andyy121:mysql_real_escape_string
will require a database connection.
I would suggest you approach from a different angle
if (isset($_POST['keyword'])){
$keywords = strip_tags(trim($_POST['keywords']));
echo $keywords; // remove the ''
}
else {
echo "Keywords is empty";
}
Sorry Squidge. I wasn't aware.
No worries RyanTroop :)
hey genius this is the code what i have to do????
Firstly, very uncalled for.
Secondly, and I will put this very easy for you as the last 2 time i have said dont seem to register.
IS THE INC FILE IN THE SAME FOLDER AS THE SCRIPT CALLING IT
IS THE CODE YOU HAVE PASTED IN THE SAME FOLDER AS FUNCK.INC.PHP
You are on a forum asking for help, and in my opion not listening to what has been put to you, and being rude.
where is the xxx.inc.php kept in relation to the calling script??
Without that no can help you. Basically the error you are getting is indicating the file is not in the same folder. If it is another folder then you need to call it in, in the same manner as you would with css files that are located in different areas.
Is your call correct? Is funck.inc.php in the same folder as the script calling it?
Yes, well done. Although that will only work if you have short tags enabled other wise you have to use <?php ?>
Let me knnow how you get on :)
This is assuming that you are using ?
as placement for $_GET['room']
This is a changed line 20 onwards. If you are not using $dbQuery
, i would suggest removing it
$dbh = new PDO('mysql:host=localhost;dbname=Classroom',$user,$pass);
$stmt = $dbh->prepare("SELECT * FROM MainDB where ID=:id");
$stmt->bindParam(':id', $_GET['room']);
$stmt->execute();
$stmt->setFetchMode(PDO::FETCH_ASSOC);
while($row = $stmt->fetch())
{
print_r($row);
}
Sorry forgot to add i change AccountNumber to bigint(20)
That was where the problem was
I am still learning as well, bought a book to help me a long the way. It did look to be a very steep learning curve but i am slowly getting my head around it. If you need more assistance please let me know.
As a strating point
$dbQuery = "Select MainDB.SeatingCap, MainDB.ID, MainDB.Building, MainDB.Room, MainDB.ID, ";
$dbQuery .= "BuildingDB.BuildingName, BuildingDB.BuildingAbv, MainDB.Wheelchair, ";
$dbQuery .= "MainDB.Lighting, MainDB.AdditionalInfo, MainDB.Contact, ";
$dbQuery .= "LightingControlsDB.LightingControlsID, LightingControlsDB.LightingType, MainDB.Windows, WindowDB.WindowID, ";
$dbQuery .= "WindowDB.WindowTreatment, MainDB.FP";
$dbQuery .= " from MainDB ";
$dbQuery .= "Left JOIN BuildingDB on MainDB.Building = BuildingDB.BuildingID ";
$dbQuery .= "Left JOIN LightingControlsDB on MainDB.Lighting = LightingControlsDB.LightingControlsID ";
$dbQuery .= "Left JOIN WindowDB on MainDB.Windows = WindowDB.WindowID ";
$dbQuery .= "where MainDB.ID = '" . stripslashes($Room) . "' ";
Can still be used:
$stmt = $dbh->prepare($dbQuery);
$stmt->execute();
tested this:
if(isset($_POST['bankname']))
{
if(isset($_POST['acc']))
{
$con = mysql_connect("localhost","root",""); // change to your details
mysql_select_db("test",$con); // change test to your DB
$sql = "INSERT INTO `paymentmethod`(`id`,`PaymentName`,`AccountNumber`) VALUES('','$_POST[bankname]','$_POST[acc]')";
mysql_query($sql,$con);
mysql_close($con);
}
else
{
echo'Please enter your bank account number';
}
}
else
{
echo'Please enter your bank name';
}
how is you db table set?
can you provide your table structure?
please post the content of var_dump($_SESSION);
from one of your lang pages. This dont just disappear unless something has destroyed them
Also the content of $_COOKIE
$user_name = $user_name .= "@gmail.com";
Try changing this line [17] to :
$user_name = $user_name ."@gmail.com";
Then check $user_name before and after using var_dump to insure it has filled
Also try this function function login( $user_name, $password )
with hard entered data to make sure
Ok then, lets start again, as you have now changed the coding to what to had put in your first POST.
Are you getting an error?
you mean the "put" part of it right?
Correct.
Is this your coding? Or are you running through a tutorial?
Take line 62 of the code above:
$this->put('title', $v['title']);
It is a call to a function with in a class that has either been missed on the above snippet, or esides within a different function, but in the same call.
Have a look at the php.net example 1 here: example
This should help to clarify.
!!EDIT!!
Sorry I meant line 63
I am still finding my way with OOP, but it looks like a base login validater class/function that creates a database connection and validates against the form input, although this is only a fraction of the class.
What is the top section of your Lang pages?
Does it still contain session_start()?
var_dump
is useful for seeing data held in an array, similar to print_r
.
So for example to get the data within the $_SESSION
array you would use:
var_dump($_SESSION);
Any data held in this would then be displayed. Which allows you to see what, if anything, is within this array
Have you tried var_dump on the $_SESSION from one of the lang pages?
How are you holoding the $_SESSION data?
Could you find a uniformed naming for it?
::SOLVED::
Cannot run the install of PEAR when Apache and MySQL are installed as service.