452 Posted Topics

Member Avatar for GlenRogers

That is because a DELETE query will always return TRUE if it could be executed, and it *can* be executed, even if no rows are affected by it. If you want to count the number of rows affected (the number of rows deleted), which would tell you if anything has …

Member Avatar for GlenRogers
0
213
Member Avatar for martjojo1

Well that is because you use double quotes, and any PHP variable typed plainly within double quotes will take and output the value of that variable. In other words, if $root = NULL, it will output empty space if used inside double quotes. If you want to output literally "$root" …

Member Avatar for martjojo1
0
135
Member Avatar for MasterHacker110

That will work, but how will you create each unique file? By hand or? ;) Here's a quick setup on a basic login script: 1. Create a database table containing user login data (user_id, username, password (encrypted if you wish!)). 2. Create a login script, that matches the submitted login …

Member Avatar for MasterHacker110
0
192
Member Avatar for MasterHacker110

First of all, using $_REQUEST may pose some danger to security, because if I would now go to your PHP file's location and put "?submit=true&email=somedangerousvirus" in the link, I would gain access to writing a file to your server. Then, why would your file writing not be working? Did you …

Member Avatar for minitauros
0
213
Member Avatar for Gabe13

Well that's probably because something has gone wrong while executing your query. Try adding OR exit(mysql_error()) to your query lines, so that it would become, for example: ` $checkUserQuery = mysql_query("SELECT * FROM $tbl_name WHERE userName = '$user'") OR exit(mysql_error());` `$checkEmailQuery = mysql_query("SELECT * FROM $tbl_name WHERE email = '$email'") …

Member Avatar for broj1
0
239
Member Avatar for bsewell

Don't you have access to your DNS settings? If so, you could just change the DNS settings of your domain A to load domain B instead. I'm no DNS expert, but I think that is possible. If so (or if not) I hope that there's anyone else here that can …

Member Avatar for bsewell
0
788
Member Avatar for chrispitt

> Types of errors in php: 1.) Parse Error or Syntax Error, 2.) Fatal Error, 3.) Warning Error, 4.) Notice Error And of those number 1 and 2 will stop executing your script, while 3 and 4 will not. In other words: in case 1 and 2 your script will …

Member Avatar for jkon
0
244
Member Avatar for mr.unknown
Re: php

Mr. unknown, are you following a tutorial on how to start with PHP or? :)

Member Avatar for jkon
0
256
Member Avatar for dina85

When do you want to display this information? During the upload process, or after the upload process has completed? I presume it is the first, in which case I would advise you to search Google for an AJAX file uploader. There are plenty of them on the internet, I'm convinced …

Member Avatar for minitauros
0
263
Member Avatar for dina85

$sql="select image from images where id='$_GET[id]';"; I think you should remove the first semicolon in that line and place it after the following line: $row = mysql_fetch_array($result) Next question: What is the error you are getting? :) Also, if you are using PHP's mysql functions to connect to your database, …

Member Avatar for minitauros
0
270
Member Avatar for dhani09

Did you: 1. Check if you started a session in both files, using session_start()? 2. Validate that each $row actually contains the values you expect it to contain? You can use var_dump($row), for example, to output a row (or print_r($row)). 3. On your second page - manage-products2.php - you could …

Member Avatar for minitauros
0
1K
Member Avatar for PF2G

That error means that you do not have your CURL extension enabled. Are you running a local server or a hosted server? If you are using a local server, you can navigate to the folder in which your php.ini file resides (for me that's "\xampp\php"), open up that php.ini file, …

Member Avatar for pritaeas
0
251
Member Avatar for eburlea

Have you checked out the create_function() function? See here: http://php.net/manual/en/function.create-function.php

Member Avatar for eburlea
0
347
Member Avatar for rajhoq12

Plus there are huge communities for PHP, so if you get stuck you'll probably be able to get help fast. There are a lot of popular CMS'es being written in PHP, so if you want to use those, having some PHP knowledge can be useful.

Member Avatar for <M/>
1
501
Member Avatar for Tko_1

Change this: function browse($dir) { global $filenames; if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && is_file($dir.'/'.$file)) { $filenames[] = $dir.'/'.$file; } else if ($file != "." && $file != ".." && is_dir($dir.'/'.$file)) { browse($dir.'/'.$file); } } closedir($handle); …

Member Avatar for Tko_1
0
198
Member Avatar for Webville312

Well there certainly seems to be no error on line 37 of the script you presented to us. Could you echo your query and post it here? (E.g. $query = [your query goes here]; echo $query; )

Member Avatar for Webville312
0
351
Member Avatar for minitauros

Hello there, I would like to know if anyone knows a solution for excluding a group within a group in a regular expression. For example: /(name|(?:last[ ])name|(?:first[ ])name)/i I would only like the word "name" to be returned (this is just an example), but when I take match number 1 …

Member Avatar for minitauros
0
342
Member Avatar for dottomm

Hmmm if you want both to be valid, try: '/^(\d{5})?([a-z.\-&'",\/\\ ]+)(\d+)$/i' This checks for: Must start with a digit of length 5 (because of the {5} part) or no digits (because of the questionmark after the ")") Must then be followed by one or more words Must end in a …

Member Avatar for pritaeas
0
171
Member Avatar for RaeesIqbal

"x equals x" is written with 2 times an "=", not one time ;). You are now setting a new value for $n in each if() statement. You should write it as $n == 3 instead of $n = 3. Also you're not comparing your results correctly. In line 2 …

Member Avatar for minitauros
0
141
Member Avatar for joshl_1995

Try using absolute paths to your css files. E.g. not css/stylesheet.css, but /css/stylesheet.css or http://www.yourwebsite.com/css/stylesheet.css

Member Avatar for joshl_1995
0
193
Member Avatar for beginnerpals

Your code should work, as you have a redirect in logout.php, which means that if you were to press backspace after you've been redirected, you would end up in logout.php again, which would redirect you to index.php :o.

Member Avatar for imBaCodes
1
12K
Member Avatar for fheppell

So where are you getting these links? Are they the link of the page the user is currently on? Or are you retrieving them from a database or something like that? For the rest, you could use regular expressions to find the base part of the link. I think something …

Member Avatar for CodeAngry
0
408
Member Avatar for Martin C++

> Also, for the error function, add a parameter (data) to it so that you can see what error is coming back. What stbuchok says :). Usually when I get an error it's because the specified file cannot be found. Javascript does not always use the same working directory as …

Member Avatar for Martin C++
0
170
Member Avatar for Jollyyy100

It is, but I think you should just follow the tutorials that explain how to do that (or download the full scripts and implement them). It's a bit much to explain here I'm afraid. Lucky for you, you already have one "tutorial" waiting for you there (http://www.building58.com/examples/tabSlideOut.html). For the other …

Member Avatar for Jollyyy100
0
322
Member Avatar for Daniel Claff

Hm this might not be what you're looking for but have you thought about using HTML for that? ;) For example: <a href="[specify a link]">[specify a title]</a> Which could become: <a href="website.com/page.php?id=$id">CLICK HERE</a>

Member Avatar for masterjiraya
0
271
Member Avatar for Daniel Claff

Usually the value of "href" is included within double quotes. E.g. <a href="http://www.google.com">Google</a>. Have you tried that? :)

Member Avatar for Squidge
0
250
Member Avatar for cssweb

Well I don't think it is necessary to have sec_id and topic_id be the same ID. What you can do is: **Table 1 (sections):** id | section_name **Table 2 (topics):** id | section_id | topic_name Then when a user opens for example the section with the ID 1, you could …

Member Avatar for cssweb
0
428
Member Avatar for skliz

I haven't ever implemented such a thing myself, but when I googled PHP long polling, this is what looked interesting to me: http://www.nolithius.com/game-development/comet-long-polling-with-php-and-jquery http://blog.perplexedlabs.com/2009/05/04/php-jquery-ajax-javascript-long-polling/ Maybe it can help you :).

Member Avatar for pritaeas
0
1K
Member Avatar for amith_ami

You can either create a JOIN in your original query, or execute a subquery for each subcategory. In the first case you'd have to use PHP to detect the start of a new section. **With a JOIN:** <?php $q = 'SELECT tbl_categories.cat_id, tbl_categories.cat_name, tbl_subcategories.subcat_id, tbl_subcategories.subcat_name, FROM tbl_subcategories JOIN tbl_categories ON …

Member Avatar for amith_ami
0
6K
Member Avatar for abhi10kumar
Member Avatar for broj1
0
225
Member Avatar for nstrazimiri

Well for starters, there appears to be missing a " at the start of your content definition (content=<div id=\"content\">) :).

Member Avatar for minitauros
0
156
Member Avatar for Venter

Yea you should probably use AJAX for that :). That's an Asynchronous Javascript And XML call, which enables you to execute PHP even after the page has loaded. Check out how it works here: A tutorial at w3schools: http://www.w3schools.com/ajax/ The jQuery documentation: http://api.jquery.com/jQuery.ajax/

Member Avatar for minitauros
0
262
Member Avatar for beginnerpals

Just a thought here: why don't you just use one field that you name "tags" (in your database). You can insert a comma separated list of tags into that field. When you retrieve it, you can [explode](http://php.net/manual/en/function.explode.php) it on the comma to create an array with tags. In that case …

Member Avatar for beginnerpals
0
239
Member Avatar for johndohmen1963

Great ^^. How did you do it? What I'd do is: <?php $parts = explode(' ', $name); for($i=0; $i<count($parts); $i++) { $first_letter = $parts[$i][0]; // Gets the first letter of the given part. $letters[] = $first_letter; } $initials_only = implode('.', array_map('strtoupper', $letters));

Member Avatar for minitauros
0
132
Member Avatar for Martin C++

**About your regex:** You are checking only the first letter of your input string :). [A-Za-z0-9] checks one characters [A-Za-z0-9]+ checks 1 - infinity characters (until one is found that does not match), which means that at least one MUST match [A-Za-z0-9]* checks 0 - infinity characters, which means no …

Member Avatar for Martin C++
0
188
Member Avatar for aisha.edris1
Member Avatar for EdvinasSelskas

What is says is that $media->group->thumbnail[0] is not an object. Maybe you could find out why? I haven't worked with simplexml for a while, but maybe it doesn't give all the properties it contains the possibility to use the attributes() function? Just some thoughts ^^.

Member Avatar for EdvinasSelskas
0
918
Member Avatar for johnnycho

Hm that is strange indeed. Usually you should be able to modify globally defined variables from within a function. What's particulary strange is that the $film_ids variable does get filled within the function, but then appears to be empty in your global scope. I assume you are checking the value …

Member Avatar for johnnycho
0
317
Member Avatar for HelloJarvis

I'm not sure but what you could try is containing the $(".delete").click(function() { alert("hello"); }); part inside the first function of your hover() function.

Member Avatar for HelloJarvis
0
212
Member Avatar for adishardis
Member Avatar for diafol
0
281
Member Avatar for davidjennings

Just a usability note: "Your form submission has an error." is kind of an unclear error message. Do you really want the user to read such a thing? He might get confused ;).

Member Avatar for Webville312
0
416
Member Avatar for t_thakar

Well what you could do is: Put the logout script in a separate file. Then, when the user clicks "logout", he is sent to that file. The logout file redirects him to the homepage. So then, when the user clicks "back" when he is on the home page, he is …

Member Avatar for diafol
0
130
Member Avatar for 4fridi

What you can do is redirect everything to index.php, then in index.php you read your URI by using $_SERVER['REQUEST_URI'], and then parsing that info. E.g. if REQUEST_URI returns "page/a-nice-html-page/" you could explode that data on the "/", scan that array and take the required actions in index.php. E.g. if $return[0] …

Member Avatar for 4fridi
0
172
Member Avatar for korathualex

Yup, the focus() function sets the focus to the target element :). For documentation, click [here](http://www.w3schools.com/jsref/met_html_focus.asp).

Member Avatar for BMXDad
0
149
Member Avatar for davy_yg

Hmm what you could do is make your system remember where it puts which images. For example if it saves an image under the name "randomname123.jpg" and that image belongs to page 1, you could put a record in your database saying that "page 1" is connected to "randomname123.jpg", if …

Member Avatar for pixelsoul
0
225
Member Avatar for suavedesign

If I'm not mistaking, jQuery's [animate()](http://api.jquery.com/animate/) function let's you specify a function to execute when the animation finishes. If you put a [timeOut](http://www.w3schools.com/js/js_timing.asp) in that function that launches your second animation upon timeout, you should see what you want to see, I guess ^^.

Member Avatar for pixelsoul
0
116
Member Avatar for minitauros

Hey there. The situation is like this: 1. The user clicks a button. 2. Tooltip pops up. 3. The user clicks the button again OR the user clicks anywhere outside the tooltip. 4. The tooltip is removed. Now I can get either of the events described in step 3 to …

Member Avatar for minitauros
0
3K
Member Avatar for Khav

For the first problem: <?php $q = 'SELECT anything FROM copyright WHERE copyr_md5 = "' . mysql_real_escape_string($md5check) . '" LIMIT 1'; $rq = mysql_query($q); $fetch = mysql_fetch_assoc($rq); if($fetch) { // A record that matches $md5check has been found. } ?> For the second problem: <?php $q = 'SELECT field1, field2, …

Member Avatar for Khav
0
247
Member Avatar for PriteshP23

Well you could write that a bit cleaner :). For example I'd use a switch (but maybe you should think about putting all this in a database). <?php $diagnostics = $_POST['diagnostics']; $room = $_POST['room']; if($diagnostics == 'Plomb CREP') { switch($room) { case '95': $price = 120; break; case '100': $price …

Member Avatar for PriteshP23
0
294
Member Avatar for minitauros

I just started wondering.. I have a bass class, let's say a class called Framework. This class contains a lot of functions and sets a couple of variables that are used inside other classes. What would be the most efficient way to access these variables from inside other classes? Should …

Member Avatar for jkon
0
382

The End.