Search found 49 matches

by MikeSpider
Mon Jun 17, 2013 3:38 am
Forum: PHP coding => General
Topic: Works in localhost but not in remote host
Replies: 6
Views: 1845

Re: Works in localhost but not in remote host

I've just eliminated a few more possible causes, what is happening, is only with the 'address' field in table, as I put other fields data in the alert function, it works for every record, the address field only works in one of the records. And it is not random! it targets a specific record! I tried ...
by MikeSpider
Sun Jun 16, 2013 6:31 am
Forum: PHP coding => General
Topic: Works in localhost but not in remote host
Replies: 6
Views: 1845

Re: Works in localhost but not in remote host

Hi John, The values coming from db are all correct, as a matter of fact i use the same $s['address'] and the same loop to display the data on page before a user clicks and the $s['address] is passed into a javascript function. A I said previously it only gets first item. As if the data breaks out of...
by MikeSpider
Thu Jun 13, 2013 3:22 pm
Forum: PHP coding => General
Topic: Works in localhost but not in remote host
Replies: 6
Views: 1845

Re: Works in localhost but not in remote host

Hi, send us a piece of source code. At least the first images ,.. thanks Thanks for replying. I dont understand what you mean by "the first images" The images appear fine. no problem. the PHP code is: public function getAllServices($type){ try{ if($type == "PickUP"){ $serviceTbl = 'pickUpServices';...
by MikeSpider
Sat Jun 08, 2013 3:21 am
Forum: mySQL & php coding
Topic: Copying Items from one table to another
Replies: 6
Views: 2022

Re: Copying Items from one table to another

Hi again,

Yes it worked! I only added the "WHERE" clause in the second query as it was the only thing missing.

Dont know how I missed that one :oops: . Anyways, thanks a bunch! :D

Mike
by MikeSpider
Fri Jun 07, 2013 8:15 am
Forum: mySQL & php coding
Topic: Copying Items from one table to another
Replies: 6
Views: 2022

Re: Copying Items from one table to another

Hi again, I modified the script a little but still, isn't working properly. the second query is only returning one item, i tried to add another loop but it just multiplied the same thing. what happens is, it works only for 1 repeated item (id =1), not for all. Here's the script: public function Inse...
by MikeSpider
Fri Jun 07, 2013 3:36 am
Forum: mySQL & php coding
Topic: Copying Items from one table to another
Replies: 6
Views: 2022

Re: Copying Items from one table to another

Sorry for taking so long to respond.
I've been away for a while and just seen your reply.

I'm having a try now, will let you know of the outcome.

many thanks,

Mike
by MikeSpider
Fri Jun 07, 2013 3:16 am
Forum: PHP coding => General
Topic: Works in localhost but not in remote host
Replies: 6
Views: 1845

Works in localhost but not in remote host

Hi guys, I have this script looping through database data: foreach ($getService->data as $s){ echo " <p>Name: ".$s['name]."</p>" echo "<img style=\"cursor:pointer;\" src=\"images/icons/mapicon.png\" width=\"32\" alt=\"Find in map\" onclick=\"alert('".$s['address']."')\"> <img style=\"cursor:pointer;...
by MikeSpider
Tue Apr 30, 2013 9:07 am
Forum: mySQL & php coding
Topic: Copying Items from one table to another
Replies: 6
Views: 2022

Copying Items from one table to another

Hi guys, I have one table 'expenses' and another table 'inventory'. They don't have similar structure. once in a while the user will add items from the 'expenses' to the 'inventory'. But I want for only items that do not already exist in the inventory to be inserted. I want to avoid duplicates or an...
by MikeSpider
Wed Nov 21, 2012 7:08 pm
Forum: PHP & MySQL Security
Topic: Hiding file extensions through .HTACCESS
Replies: 1
Views: 3512

Hiding file extensions through .HTACCESS

Hi guys, I came across this on the web: Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.+)$ /$1.php [L,QSA] I created a .htaccess file in my project root folder, paste...
by MikeSpider
Wed Nov 21, 2012 12:37 pm
Forum: mySQL & php coding
Topic: SQL inside For loop
Replies: 2
Views: 941

Re: SQL inside For loop

OK I got it working!
it was missing a parenthesis.
Would this sort of technique harm my db in any way or my application?

Should I just use SQL concatenation like : INSERT INTO mytable VALUES(1,,5,3),(6,8,5).... ?

Mike
by MikeSpider
Wed Nov 21, 2012 11:36 am
Forum: mySQL & php coding
Topic: SQL inside For loop
Replies: 2
Views: 941

SQL inside For loop

Hi guys, Is it possible for something like this to work? <?php $Fcategories = array('Arts','Internet', 'Media','Music','traveling','TV Shows'); for($i = 0; $i < count($Fcategories); $i++){ $sql = "INSERT INTO forumCategories VALUES(NULL,'{$Fcategories[$i]}','{$_SESSION['forum_admin']}', NOW()"; $res...
by MikeSpider
Wed Nov 21, 2012 9:44 am
Forum: PHP coding => General
Topic: Checking page name to change links class
Replies: 4
Views: 1412

Re: Checking page name to change links class

Yes it worked.
so, one thing I understand now is that $_SERVER['PHP_SELF'], always refers to my htdocs folder as a root, and then the project name and then the page !?

I used as path: /myproject/

Thanks a lot for your help.

Mike
by MikeSpider
Wed Nov 21, 2012 9:04 am
Forum: PHP coding => General
Topic: Checking page name to change links class
Replies: 4
Views: 1412

Re: Checking page name to change links class

Hi,
thanks for your reply.

I tried :

Code: Select all

$_SERVER['PHP_SELF']) == "localhost/Mypage/" . $menuItems[$i] . ".php"
not working, also tried: Mypage/. $menuItems[$i] . ".php"
and "../".$menuItems[$i].'.php')
not working either.

thanks,
Mike
by MikeSpider
Wed Nov 21, 2012 7:45 am
Forum: PHP coding => General
Topic: Checking page name to change links class
Replies: 4
Views: 1412

Checking page name to change links class

Hi guys, I wrote a script to indicate the active page by changing the element class. But it's not working, need some help. Here is the script: <?php $menuItems = array('home', 'create','projects','forums', 'connections','settings','login','donate'); for($i=0; $i< count($menuItems); $i++){ if($_SERVE...
by MikeSpider
Mon Nov 19, 2012 6:15 pm
Forum: PHP coding => General
Topic: Using PHP and Mysql to control CSS /HTML elements
Replies: 3
Views: 1176

Re: Using PHP and Mysql to control CSS /HTML elements

yes that's much easier.
Thanks
by MikeSpider
Mon Nov 19, 2012 3:00 pm
Forum: PHP coding => General
Topic: Using PHP and Mysql to control CSS /HTML elements
Replies: 3
Views: 1176

Using PHP and Mysql to control CSS /HTML elements

Hi guys, this is something I have been doing a long time but I really don't know if this is the right path. I'll give a basic example. if I have a stock table, and I want the row to have a yellow background color code warning when an item reaches 2 in quantity, and to turn red when the item reaches ...
by MikeSpider
Sun Oct 21, 2012 2:28 pm
Forum: mySQL & php coding
Topic: Inserting and extracting Links (youtube mainly)
Replies: 1
Views: 769

Re: Inserting and extracting Links (youtube mainly)

ok I just figure it out. I forgot to put the <a> atribute lol. also the youtube links work with the embed code.
by MikeSpider
Sat Oct 20, 2012 5:03 am
Forum: mySQL & php coding
Topic: Inserting and extracting Links (youtube mainly)
Replies: 1
Views: 769

Inserting and extracting Links (youtube mainly)

Hi Guys, I created my own Content Management System to insert, retrieve, update and delete information in a database. Everything works fine. the only problem I have is with hyperlinks. If I paste an hyperlink into the textarea and insert it in database, it works, but when I retrieve it, it comes out...
by MikeSpider
Thu Sep 20, 2012 4:15 pm
Forum: PHP coding => General
Topic: "Notice: Undefined index" Error
Replies: 1
Views: 589

"Notice: Undefined index" Error

Hi guys, I just got a new pc and copied all my php projects from the old pc. I also installed the latest version of XAMPP, Netbeans and PHP. All my projects are showing the following errors: Notice: Undefined index: Submit in C:\xampp\htdocs\QuickBeam\index.php on line 8 Notice: Undefined index: act...
by MikeSpider
Sun Aug 12, 2012 7:45 am
Forum: mySQL & php coding
Topic: Select All from table if table exists
Replies: 2
Views: 1030

Select All from table if table exists

Hi guys i'm trying to add the 'exist' clause in my query so that it does not throw an error if the table doesn't exist. items from the table are presented on page load, however if the user is new and has not created any table, it says that "table does not exist". ... $pjtTbl = $user . "_" . $project...
by MikeSpider
Wed Jul 25, 2012 7:48 am
Forum: JavaScript
Topic: Confirm box only cancels
Replies: 5
Views: 1738

Re: Confirm box only cancels

Your confirm box result is not being saved, and you are not acting on the result. You removed the PHP but didn't replace the logic with client side logic. Right. I'm using this: <script type="text/javascript"> <!-- var np= confirm("You are seling a product for less than you bought! are you sure you...
by MikeSpider
Tue Jul 24, 2012 3:43 pm
Forum: JavaScript
Topic: Confirm box only cancels
Replies: 5
Views: 1738

Re: Confirm box only cancels

I took the php out of JS. but still, the confirm box apears, but the php code runs either way if i press "Ok" or "Cancel". please help. ... if($_soldfor < $_boughtfor || $_soldfor < $existing_cost){ ?> <script type="text/javascript"> <!-- confirm("You are seling a product for less than you bought! a...
by MikeSpider
Tue Jul 24, 2012 9:26 am
Forum: JavaScript
Topic: Ajax & PHP delete
Replies: 3
Views: 1361

Re: Ajax & PHP delete

It's working now, sorry I forgot to show my changes: the form: <form method="get" action="<?php echo $_SERVER['PHP_SELF'];?>" > <input type="button" name="submit" onClick="deleteSales()" value="Delete all" class="button"> </form> Ajax: <script type="text/javascript"> <!-- function deleteSales(){ if ...
by MikeSpider
Tue Jul 24, 2012 9:11 am
Forum: JavaScript
Topic: Ajax & PHP delete
Replies: 3
Views: 1361

Re: Ajax & PHP delete

hehehe, you were right though, i've done other form connecting with db via ajax with no action and the ajax script was separated with 2 functions, the diference being that it was passing some parameters in the url.

Thanks
Mike
by MikeSpider
Tue Jul 24, 2012 8:42 am
Forum: JavaScript
Topic: Confirm box only cancels
Replies: 5
Views: 1738

Re: Confirm box only cancels

You cannot call PHP inside of your JavaScript. You are trying to execute Server-side actions after the server has finished processing and served up data. http://www.virtualshowrooms.co.za/articlepage.php?cp=101 What should I do then? I want the php script to execute only if the user presses "ok",.