492 Posted Topics

Member Avatar for antwan1986

First, php.net is a great place to start to learn about the functions and can be alot quicker than asking here ;) One thing i will say, is never, ever use $_POST, $_GET, $_QUERY...etc directly in SQL queries or the like (you're asking for trouble if you do), always sanitize …

Member Avatar for antwan1986
0
150
Member Avatar for jackakos

I had a quick look at your script, the first thing I noticed was that these lines: [code=php] //get parts of records $get_list = "select emp_no, concat_ws(', ', lname, fname) as display_name from employee order by lname, fname"; $get_list_res = mysql_query($get_list) or die(mysql_error()); [/code] were within the IF statement so …

Member Avatar for jackakos
0
148
Member Avatar for dflor

Do you have the php_mysql.dll in the correct place and have you changed the line [code] ;extension=php_mysql.dll [/code] to [code] extension=php_mysql.dll [/code] in your php.ini file?

Member Avatar for dflor
0
78
Member Avatar for architact

The suggestions einfoway made are correct, however there are other factors to take into account, for example some people do not have JavaScript enabled so the Javascript validation and AJAX will not work for this so it would not be a good idea to rely on this. It would be …

Member Avatar for R0bb0b
0
162
Member Avatar for servantofgod

The rewrites will be the easy part as these are just REGEX in your .htaccess file. The rest of the work would be a huge task, all your links on all pages would need to be updated to the new format. Take a look at [url]http://www.workingwith.me.uk/articles/scripting/mod_rewrite[/url] for rewrite descriptions and …

Member Avatar for servantofgod
0
258
Member Avatar for Zack2008

Try to use some standard in your coding, rather than some caps and some lower case, for example SQL commands in caps and value in lower case, makes it easier to read You would do well to add an error handle to the end of the SQL query to see …

Member Avatar for Zack2008
0
103
Member Avatar for acs_cobra

You would be looking at AJAX(JavaScript) to don this without the page reloading and a database to store the image locations in and populate the lists in order to do this.

Member Avatar for acs_cobra
0
105
Member Avatar for tamaryk
Re: Blog

This will require some server-side scripting to achieve what you are looking for, PHP is a popular choice for similar solutions. Check what your webserver can support and search the internet, there are many packages available which fit what you describe.

Member Avatar for hughv
0
44
Member Avatar for god_1896

Please use the code tags to put code on here. From the information you provided it would not be possible to tell you what the issue is: 1. You have not said what is and what is not working 2. In the code you have posted you are using objects/variables …

Member Avatar for god_1896
0
152
Member Avatar for virajmm

If you want to do this without reloading the page, you will need to look into JavaScript (specifically, AJAX if this is connected to a database) If you are happy to reload the page, you would need to employ some kind of session or cookies to keep track of rows …

Member Avatar for Will Gresham
0
89
Member Avatar for jackakos

Make sure you put your code in code tags. [code=php] if (($_SERVER['REQUEST_METHOD'] == "POST") || ($_SERVER['Submit7'] == "Next")) { $eventdate = $_POST['eventdate']; $stime = $_POST['stime']; $location = $_POST['locate']; $mdescription = $_POST['description']; header('location:next.php'); exit(); }[/code] Would it not be better to replace the IF statement with [code=php] if (isset($_POST['Submit7'])) { [/code] …

Member Avatar for Will Gresham
0
220
Member Avatar for ike185

A quick web search will bring up the answer you are looking for, the option is called [icode]Indexes[/icode] in the Options within the htaccess file add [icode]Options -Indexes[/icode] (if you already have some Options listed, add the -Indexes to the end. Further reading: [url]http://www.clockwatchers.com/htaccess_dir.html[/url]

Member Avatar for ike185
0
148
Member Avatar for mrcniceguy

Are you storing this in the database as a timestamp, date, or string? One way to convert it is when you fetch the date from the table convert it to the correct format: [code=php] $split_date=explode("/", $date_var); $date=$split_date[2] . "/" . $split_date[1] . "/" . $split_date[0]; [/code] Depending on which format …

Member Avatar for mrcniceguy
0
139
Member Avatar for ribot

I would suggest doing something like the following: Create a new page (such as process.php) and put the following code into it: [code=php] <? session_start(); //Store the POST and GET data into the session $_SESSION['post_data'] = $_POST['test']; $_SESSION['get_data'] = $_GET['test']; //Redirect to the correct page header("Location: index.php?test=hi"); ?>[/code] This will …

Member Avatar for ribot
0
101
Member Avatar for yasmena

If I am understanding you correctly, the following should work: In the script containing the <head> add something like this inside the <head></head> tags: [code=php] <? $currentFile = $_SERVER["SCRIPT_NAME"]; $parts = Explode('/', $currentFile); $currentFile = $parts[count($parts) - 1]; if($currentFile == 'admin.php') { //put JS code here } ?> [/code] This …

Member Avatar for R0bb0b
0
132
Member Avatar for ayshasherilps

Personally I would not use the second example-saving images into the Database, there is no need. The filesystem was designed to do this job so why re-invent the wheel? I have yet to come across a scenario where storing images in the database is better than the filesystem.

Member Avatar for R0bb0b
0
130
Member Avatar for mrcniceguy

One way to do this would be to include an if statement and a counter for example, [code=php] $counter=0 while(sql_statement) { $id=$row['id']; $date=$row['date']; $sentby=$row['sender']; $comment=$row[comment]; if($counter==4) { echo "<br />"; // reset the counter $counter = 0; } echo"sent by: $sentby Comment:$comment date sent:$date"; $counter++; } [/code]

Member Avatar for mrcniceguy
0
95
Member Avatar for mrcniceguy

This is fairly simple, use the RAND function in the SQL query: [code=php] $sql = "SELECT * FROM tablename WHERE somefield='something' ORDER BY RAND() LIMIT 10"; [/code]

Member Avatar for mrcniceguy
0
86
Member Avatar for bear24

Simply use the HTML a tag to make it a hyperlink [code=php]<a title="link_title" href="link_here"><? echo $rows['topic'];?></a>[/code] In the database you also need to have the unique identifier for the row and make the link something like mypage.php?topicid=ID where ID is the identifier.

Member Avatar for bear24
0
98
Member Avatar for websurfer

There is no way to hide HTML or JavaScript code from the user, these are client-side scripts and will need to be processed by the client browser, as such the code will need to be sent and can be viewed. The PHP code cannot alter this since it is a …

Member Avatar for nikesh.yadav
0
86
Member Avatar for SiRuS

As far as I am aware this can only be done with the ID3 library (unless you name the MP3's in a standard format such as Artist-Genre-Song.mp3) If ID3 already exists and is the standard why would you want to make your own methods? I know you said without ID3 …

Member Avatar for Will Gresham
0
84
Member Avatar for Peda

I would have thought this goes in the HTML/CSS forum [url=http://www.daniweb.com/forums/forum143.html]here[/url] Although I would suggest running the page through a validator ([url]http://validator.w3.org/[/url]) first since there are multiple problems on all pages.

Member Avatar for Peda
0
115
Member Avatar for sarithak

Have you cheked where the server is looking for the font and that the ttf file is in the correct directory on the server?

Member Avatar for rshay
0
107
Member Avatar for ajie6673

[QUOTE=pzuurveen;696597] [B]at the start of search-exec.php[/B][/QUOTE] Follow that ^

Member Avatar for Will Gresham
0
100
Member Avatar for MadMaxy

1. Lookup the update statement on the internet, the syntax for it is not correct, you can't simply replace INSERT with UPDATE, you need to completely re-write it, basics below: [code=php]mysql_query("UPDATE table_name SET row_name = value, rowname = value WHERE row_name = 'value'"); [/code] 2. Are there any unescaped quotes …

Member Avatar for srilakshmitr7
0
123
Member Avatar for Will Gresham

I have upgraded to Firefox 2.0.0.14 on openSuse 10.3 and then downloaded Java 6u6 and installed that, created a symbolic link to java plugin for firefox but whenever I try to load a Java applet it will not show anything, not even the jigsaw piece saying Java is not installed. …

0
202
Member Avatar for djMot

In the httpd.conf file you should have a line similar to [icode] DirectoryIndex index.html[/icode] Change this to [icode] DirectoryIndex index.php[/icode]

Member Avatar for djMot
0
147
Member Avatar for OmniX

The best way to do this would probably be an array: [code] $abc=array("value1","value2"); for($i = 0; $i < 2; $i++) { echo $abc[$i]; } [/code]

Member Avatar for OmniX
0
127
Member Avatar for kitsune

If you mean the popup window that appears in your browser asking for a username and password, this relies on the htaccess and htpasswd files, was it this you are looking for or another type of login box?

Member Avatar for Traicey
0
100
Member Avatar for rickarro

add this before the while(): [CODE] if(mysql_num_rows($result)<1) { echo 'No Results'; } else { // while statement here } [/CODE] This will determine if the query is returning a result

Member Avatar for rickarro
0
357
Member Avatar for kevin wood

Before the form you will need to generate the random number, also you have specified no value for the hidden field, change method= to value=. To generate the random number do something like this: [code] <? // mt_rand(min value, max value) $rand = mt_rand(); ?> [/code]

Member Avatar for ShawnCplus
0
121
Member Avatar for bintang

We need a little more information on what you want to do; Do you have passwords in a database, htpasswd file, or other means? Do you have any code at the moment and what does it do? are the passwords encrypted or plain text?

Member Avatar for Will Gresham
0
52
Member Avatar for mom_of_3

If you make a single page (for example index.php) and include the language file depending on which language is wanted, this is a perfectly acceptable use of the define() function. as it will standardize the scripts.

Member Avatar for mom_of_3
0
100
Member Avatar for priyala
Re: HTML

Using just PHP and JavaScript, you would be limited on what you can do, your pages would be unformatted, lines of text. HTML is essentially a prerequisite to PHP and Javascript. PHP is a server-side language and will send plain text to the user and JavaScript, although a client-side scripting …

Member Avatar for allen.jes
0
87
Member Avatar for webguru07

The only way to do this would be to have the header() at the top, before any output on the page. What exactly are you trying to do?

Member Avatar for buddylee17
0
70
Member Avatar for CBnewbie

comment the $set and $row_set lines and add this: echo($setSQL); and post the result here.

Member Avatar for pritaeas
0
93
Member Avatar for uncoversports

You can pass data between pages either using sessions or cookies, In the database you would need to have another column along with the username and password for the user level or status. The simplest way to have user level restrictions would be to have tiers, for example, photographers are …

Member Avatar for Will Gresham
0
144
Member Avatar for antwan1986

If you type this into a text editor with a line break and then copy/paste it into the database, this will also be moved into the SQL field and PHP will echo a new line as well as the code. Another thing, when getting HTML from the db, you will …

Member Avatar for Will Gresham
0
123
Member Avatar for farahphp

There are alot of artices on this subject from a quick google search for' javascript popup reload parent' (remember, Google is a friend) What you need to do is on the popup have a function to close the window and reload the parent ( window.opener.location.reload(true); ) at the same time. …

Member Avatar for Will Gresham
0
82
Member Avatar for xylude

The header function must be used before any output is printed, i.e before the opening HTML tag, make sure there is no HTML code or echo/print functions before the header one.

Member Avatar for xylude
0
341
Member Avatar for OmniX

It is the mysql_free_result function you would use, example below: [CODE] $connect = mysql_connect("server", "username", "password"); if (!$connect) { die('Could not connect: ' . mysql_error()); } mysql_select_db("dbName",$connect); $sqlQuery = "SELECT * from table"; $result = mysql_query($sqlQuery,$connect); // Do something with the result // Free result mysql_free_result($result); [/CODE] What error (if …

Member Avatar for Will Gresham
0
104
Member Avatar for mrcniceguy

Using the back button to go to a page form data was submitted to will cause this, to solve it, once the login script has been run either use a header redirect or a meta redirect to clear the POST data.

Member Avatar for mrcniceguy
0
96

The End.