Squidge 101 Newbie Poster

your db connection doesnt contain a password

Squidge 101 Newbie Poster

i try my best but fail,,,

What is the issue? Are you getting an error?

Squidge 101 Newbie Poster

JayJ, have you tried using return on the variable you want to pass out?

Squidge 101 Newbie Poster

You need to include session_start() at the top of loginproc.php

Squidge 101 Newbie Poster

Should be in Mysql forum:

http://bit.ly/OFmu6N

Squidge 101 Newbie Poster
// 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

Squidge 101 Newbie Poster

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.

Squidge 101 Newbie Poster
$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;

Squidge 101 Newbie Poster

From where are you populating $result from?

As per the documentation around Simple HTML DOM, str_get_html is for loading a string.

http://simplehtmldom.sourceforge.net/manual.htm

Squidge 101 Newbie Poster

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;
    }
Squidge 101 Newbie Poster

Diafol many thanks. Working like a charm

Squidge 101 Newbie Poster

@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

Squidge 101 Newbie Poster

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/>";
}
Squidge 101 Newbie Poster

@furianera;

Could you post your code? I am in need of a scrape that deals with multiple tags

Squidge 101 Newbie Poster

@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

LastMitch commented: I agree +3
Squidge 101 Newbie Poster

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

Squidge 101 Newbie Poster

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'"
Squidge 101 Newbie Poster

Post your table structure.
Post your query.

POST YOUR CODE

NO ONE CAN READ MINDS

Squidge 101 Newbie Poster

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

Squidge 101 Newbie Poster

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.

http://www.w3schools.com/php/php_mysql_intro.asp

Squidge 101 Newbie Poster

@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.

iamthwee commented: Damn right, tell it how it is +14
Squidge 101 Newbie Poster

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

Squidge 101 Newbie Poster

Error? Reason for posting? Although the $sql looks like it wont work is that correct?

Squidge 101 Newbie Poster

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";
}
Squidge 101 Newbie Poster

Sorry Squidge. I wasn't aware.

No worries RyanTroop :)

Squidge 101 Newbie Poster
Squidge 101 Newbie Poster

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.

Squidge 101 Newbie Poster

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.

Squidge 101 Newbie Poster

Is your call correct? Is funck.inc.php in the same folder as the script calling it?

Squidge 101 Newbie Poster

Yes, well done. Although that will only work if you have short tags enabled other wise you have to use <?php ?>

Squidge 101 Newbie Poster

Let me knnow how you get on :)

Squidge 101 Newbie Poster

This is assuming that you are using ? as placement for $_GET['room']

Squidge 101 Newbie Poster

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);
}
Squidge 101 Newbie Poster

Sorry forgot to add i change AccountNumber to bigint(20)

That was where the problem was

Squidge 101 Newbie Poster

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.

Squidge 101 Newbie Poster

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();
Squidge 101 Newbie Poster

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';
}
Squidge 101 Newbie Poster

how is you db table set?

can you provide your table structure?

Squidge 101 Newbie Poster

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

Squidge 101 Newbie Poster
$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

Squidge 101 Newbie Poster

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?

Squidge 101 Newbie Poster

you mean the "put" part of it right?

Correct.

Is this your coding? Or are you running through a tutorial?

Squidge 101 Newbie Poster

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

Squidge 101 Newbie Poster

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.

Squidge 101 Newbie Poster

What is the top section of your Lang pages?

Does it still contain session_start()?

Squidge 101 Newbie Poster

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

var_dump()

print_r

Squidge 101 Newbie Poster

Have you tried var_dump on the $_SESSION from one of the lang pages?

Squidge 101 Newbie Poster

How are you holoding the $_SESSION data?

Could you find a uniformed naming for it?

Squidge 101 Newbie Poster

::SOLVED::

Cannot run the install of PEAR when Apache and MySQL are installed as service.

Squidge 101 Newbie Poster

Anyone help?