708 Posted Topics
Re: do you have the class which creates the $mysqli instance. is there a function named query in the class. | |
Re: i have an upload class if you want it. i created it to upload mulitple files and i also added a thumbnailing capability. also $HTTP_POST_FILES is outdated. use $_FILES | |
Re: is it an internal messaging system for a website or are you want to retrieve real emails. | |
Re: the php time() function returns seconds. so one second = 1, one minute = 60 ect. | |
Re: get fckeditor. integration is really easy. they will have all the information you need. | |
Re: isn't this the php forum? why don't you post this question in the asp forum. | |
Re: i just finished creating one today for my latest project from work. i can post the code and let you make the neccessary changes to make it work for you if you want. | |
Re: why do you use session_register(). i thought it was depreciated. just set your user id into a session. here is some sample code [code] if (isset($_POST['submit'])) { $user = mysql_real_escape_string($_POST['user']); $pass = mysql_real_escape_string($_POST['pass']); $sql = "SELECT * FROM `tablename` WHERE `username` = '{$user}' AND `password` = '{$pass}'"; $query = mysql_query($sql); … | |
| |
Re: i created this chat: [url]http://www.daniweb.com/forums/thread126462.html[/url] which uses ajax and xml files (its pretty easy to do this with mysql so i ended up trying to challenge myself by using files). i think ajax would to solve your problem. | |
Re: i have done this before for someone on daniweb. search through old threads and you should find something that can help you. | |
Re: ajax, or use php to validate your form. i am leaving so i wont be able to provide examples right now. hopefully someone else can help, i was just trying to point you in the right direction. | |
Re: maybe try to put the $con variable with the query so it will denote which connection the query corresponds to. ex. [code] function q($sql) { $query = mysql_query($sql,$con); return $query; } [/code] | |
Re: just make a back button. and use some php to take the session variable and decrease it by one. then redirect to the correct page. | |
Re: i wouldn't use heredoc syntax in a situation like that. just use echo to output the html to page. if $i changes you could do this: [code] <?php echo <<<HTML <div>\$i is $i</div> HTML; ?> [/code] i don't know if thats what you were looking for | |
Re: why are you trying to store them in the database? its better to store them in a folder on the server and put the path to the file in the database. | |
Re: i use notepad++ and i have liked it so far. they have some pretty nice features and some great plugins people have built for it. | |
Re: make sure sanatize your inputs to protect against sql injection. as for the login, just change your query to: [code] SELECT * FROM logins WHERE uname='$uname' AND password='$pword' [/code] also, a better way to do a login script is to see the number of results returned from the query. ex. … | |
Re: wow, that is a lot of uneccessary code. why don't you use one sql query and just input the letter from the get array. | |
Re: sometimes i resort to the referrer for something like that. its not always reliable but works when it is. look up HTTP_REFERER on php.net. there a proably other ways to accomplish this but i know this way could work. | |
Re: since the user should be logged in to upload files, why don't you just put the uploaded file name into the database with their user id. then all you have to do to get the files for a certain user by one simple query: [icode]SELECT * FROM `files` WHERE `id` … | |
Re: we need to know what the error is to help you. if you would post your full code that would help as well. | |
Re: you can do that. try this: [code] $tablename = $_POST['tablename']; $sql = "CREATE TABLE `databasename`.`{$tablename}` (//table fields here)"; mysql_query($sql); [/code] | |
Re: are you wanting us to translate it into java for you or just explain what the php is doing so you can make it into java. | |
Re: open the file using fopen(), fread(), and fclose(). then parse the contents with a regex and the preg_match function. all of this with examples can be found at [url]www.php.net[/url] | |
Re: what exactly are you trying to do? maybe there is a better way???? once you explain i should be able to help. | |
Re: my company uses mailing-manager software. its easy to install. go to: [url]www.mailing-manager.com[/url] its much easier than creating a custom one. | |
Re: i would add an else statement to the if that determines if the number of rows is one. in that else statement i would open an image file that contains the "no profile image" image. read its contents and echo it out. | |
| |
Re: you can't use header() like that. you would need to make the javascript redirect using: [code] window.location = 'index.php'; [/code] | |
Re: to use them as string put quotations around them. [code] $a = '1'; [/code] then to break them up again use explode() function if you are just trying to store some data just seperate the values using commas by i think using implode(do use it much) and use [icode]explode(",",$str);[/icode] to … | |
Re: try putting [icode] or die(mysql_error());[/icode] after the mysql query. i usually have that problem when there is a sql error. | |
Re: are you tring to read the html? could you explain what you want to do in more detail. i have no idea what you are wanting to do. | |
Re: on line 26 of gif.php there is [code] if ( ! is_array ( $GIF_src ) && ! is_array ( $GIF_tim ) ) { [/code] but i don't see where $GIF_tim is coming from. should it be $GIF_dly? | |
Re: for a situtation like this I like to use a session and a switch statement. i put all of my forms into seperate html files and include them based on the survey that needs to be displayed. example (named survery.php): [code] <?php session_start(); if (!isset($_SESSION['survey'])) { $_SESSION['survey'] = 1; } … | |
Re: you use a form with either get or post method. once the form is submitted you can access this data by using: [code] //This is used when form method is get $var = $_GET['input_name']; //This is used when form method is post $var = $_POST['input_name']; [/code] input_name is the name … | |
Re: like this: [code] $sql = "LOAD DATA LOCAL INFILE ".$filename." INTO TABLE testtsttbills FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n'(account,service,date,time,timebandtype,destination,callednumber,mins,airtimecharge,tollcharge,amt,privatenumber)"; [/code] you have to escape the " | |
Re: the syntax you are looking for is: [code] $variable = "blue"; ${$variable}[] = "red"; //print array to see if it worked (did for me) print_r(${$variable}); [/code] | |
Re: thanks for posting my code so i didn't have to write it again. :) | |
Re: does it matter if the page reloads or not. if not, then i would use the $_GET method to do this. which means store the select value in the url. | |
Re: you would need to use a regex and the preg_replace function. here just found this: [code] $text = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '<a href="$1">$1</a>', $text); [/code] remember google is your friend | |
Re: yeah, php is used a lot throughout the web. I work as a PHP/Database Developer for a fairly large web design company called Heritage Web Solutions, and they use php for most of their sites. | |
Re: search daniweb. i have done this many times for other people. its not that hard. i will not provide examples so don't ask me. one search can answer your problem. either seach google or daniweb, your answer is there if you are willing to take the time to look for … | |
Re: 1. add link styling css to the page. [code] a:link { color: #000000; } a:visited { color: #000000; } a:hover { color: #000000; } a:active { color: #000000; } [/code] change the color of course. 2. i haven't used dreamweaver much but i recently got Vista and have run into … | |
Re: i would set up the database differently. the way you have it organized but hard to deal with once you are trying to get the information. make a table for movies with an id column so you can reference a movie itself. make a reviews table with 2 id colums. … | |
Re: if you are trying to echo an array you should use print_r($array). | |
Re: because contact contains the number of rows returned by the query. change: [code] $contact = mysql_num_rows($result); [/code] to [code] $contact = mysql_fetch_assoc($result); [/code] | |
Re: I use a session to remember the value. It has worked perfectly for me everytime i have done it that way. |
The End.