
onepixel
Members-
Posts
18 -
Joined
-
Last visited
Never
Everything posted by onepixel
-
Mysql is definitly the way to go if you have a small busness. It's free, found in almost all web servers and easy to use.
-
Need help with passing form variables
onepixel replied to moviejunkie's topic in Editor Help (PhpStorm, VS Code, etc)
Use $_POST global array instead with square barckets [ ] instead of parenthesis i.e $_POST['email'] -
$query="Select ID, Username, Count(*) as Posts From Tablename Group By ID";
-
$query2 = "select $accommID from booking group by $accommID having sum(case when ((booking_start_date < $book_start && booking_end_date < $book_end) || (booking_start_date > $book_start && booking_end_date > $book_end) then $flag = 1 else $flag = 0"; Parenthesis mismatch!! I notice that there is missing closing parenthesis for the one opening after "sum" and also the one opening after "when" Make sure the $query is well formatted first, test the script then if there still some problem, look at the logic behind the query.
-
login two types of members to a correct page please help.
onepixel replied to redarrow's topic in PHP Coding Help
If I understand your question there are 2 types of memberships: level1 and level2 if the member is of level1 then after correct login s/he is redirected to [a href=\"http://booking_members_page.php/\" target=\"_blank\"]http://booking_members_page.php/[/a] and if s/he is from level 2 then the redirect will to to a different URL? If that is the case, you need to add a colum in your database that will allow to store the membership level for each member (level1 and level 1). During the login your query will have to retrieve both the membership level info and with: if($row['membership']=='level1'){ header("Location: [a href=\"http://booking_members_page1.php/");\" target=\"_blank\"]http://booking_members_page1.php/");[/a] } else if($row['membership']=='level2'){ header("Location: [a href=\"http://booking_members_page1.php/");\" target=\"_blank\"]http://booking_members_page1.php/");[/a] } -
[!--quoteo(post=371467:date=May 5 2006, 03:08 AM:name=pugs1501)--][div class=\'quotetop\']QUOTE(pugs1501 @ May 5 2006, 03:08 AM) [snapback]371467[/snapback][/div][div class=\'quotemain\'][!--quotec--] I was wondering if any one could help me figure out how to setup and seck to see if a start and end date which would be stored in the mysql database have been met or not. If the start date has been met and the end date has not i want it to display the data in the table if the start date has not been met or the end date has been met then the data should disapear off the screen then. [/quote] If I understand your question the data will be displayed only if the $current_date is between your $start_date and $end_date? The date in mysql database will have the format Year-Month-Day First: $current_date=date("Y-m-d"); Let's assume the columns for the start date and end date in your database table are: start_date and end_date. Your query will be something like: $query="Select field1, field2,... from Tablename where startdate<='".$currentdate."' and enddate>='".$current_date."'"; You can then extract the results as you will.
-
You can use the FIRST CODE to display clickable categories by replacing the line: echo"<td>".$row1["category"]."</td>";$i++; by echo"<td>". "<a href=details.php?id=" . $a_result1["category"] . ">" . $a_row1["category"] . "</a>". "</td>"; $i++;
-
Your first "if" condition if not specified;
-
I suggest you use this line of Javascript code: document.inpage.open( SEARCH_DATA[selectedIndex][1] , SEARCH_DATA[selectedIndex][0] );
-
[!--quoteo(post=369927:date=Apr 29 2006, 01:28 PM:name=GBS)--][div class=\'quotetop\']QUOTE(GBS @ Apr 29 2006, 01:28 PM) [snapback]369927[/snapback][/div][div class=\'quotemain\'][!--quotec--] Thanks for the infos,,... it's more clear to me now,, So,, the most difficult thing seems to have the site linked on some high PR site,... maybe some links/tips about,...? l8tr,, [/quote] Once your site is online, you need to start your link building campaign. 1-Submit your site to directories 2-You can also write articles related to the theme of your site and submit then to e-zines. That the best way to not only build links but also bring traffic to your site. 3-You can also use link exchange programs such as: linkmarket.net linkmetro.com linkexchanged.com link2me.com 4- Start a blog to add fresh content to your site very often. That will attract SE to come back and get your site indexed. 5- Create a sitemap (Google Site Map) and submit it to Google Tip: make sure your keywords appear in your web page title. (Tres tres important!!)
-
[!--quoteo(post=369245:date=Apr 27 2006, 09:40 AM:name=phpORcaffine)--][div class=\'quotetop\']QUOTE(phpORcaffine @ Apr 27 2006, 09:40 AM) [snapback]369245[/snapback][/div][div class=\'quotemain\'][!--quotec--] What's the 'proper' syntax for multiple WHERE conditions? 1.) SELECT * FROM table WHERE col_1 = 'val_1' AND col_2 = 'val_2' ? 2.) SELECT * FROM table WHERE col=1 = 'val_1', col_2='val_2' ? [/quote] The first expression is the right one: SELECT * FROM table WHERE col_1 = 'val_1' AND col_2 = 'val_2' ;
-
[!--quoteo(post=368648:date=Apr 25 2006, 05:14 PM:name=Robby)--][div class=\'quotetop\']QUOTE(Robby @ Apr 25 2006, 05:14 PM) [snapback]368648[/snapback][/div][div class=\'quotemain\'][!--quotec--] OK, So let's say I have a folder named Gallery with files (1.jpg, 2.jpg, 3.jpg, 4.jpg etc...) and I want to create a webpage where: 1). Creates a table with X row and 5 columns 2). The table's size is dependant on the files present in the folder "Gallery" 3). I want the pictures to be thumbnail size in the table 4). Each thumbnail links to original picture (1.jpg or 2.jpg etc.) 5). if step 4 is too tough then I could have a seperate folder called " Thumbnails" with files (thumb1.jpg, thumb2.jpg etc...) linking to (1.jpg, 2.jpg etc) respectively. so If I have 32 pictures in the Gallery folder then in the webpage, I'll have 32 thumbnail sized pictures in a table with 5 columns and 7 rows and the 7th row has 2 pics and the rest of row is blank. How the bleep can I do this? I'm also new to PHP (but I know C++ to give u an idea of how much knowledge I have) and maybe PHP is too tough and perhaps there is a better way, but yeah [b]I need your help!! !![/b] THANKS!!!!!! [/quote] 1- First read the folder containing your pictures to retrieve that full-size files name. Verify sure the filename does not contain the string "thumb" before storing that file name in an array. use the stripos ( $filename, 'thumb') function to make sure the returned value is FALSE function GetPictures($dir){ $picturearray=array(); if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if(! stripos ( $file, 'thumb') ){$picturearray[]=$file; } }//end while loop closedir($dh); } } return $picturearray; }//end function No need to have two folders for the thumbnails and the full-size pictures. Just create a filter that will allow your script to know the difference. 2- Once you have that array of full picture file name, pass it to a function that can loop through to create the table string. function CreateTableString($filearray, $folderpath){ $n=count($filearray); $Str='<table width="100%" cellpadding="5" cellspacing="0" border="0"><tr>'; foreach($filearray as $k=>$file){ if($k>0 && $k%4==0){$Str.='</tr><tr>'; } $Str.='<td align="left" valign="top"><a href="'.$folderpath.'/'.$file.'"> <img src="'.$folderpath.'/thumb'.$file.'" width="80" height="80" border="0"> </a></td>'; } $r=($n%5); if($r>0){$Str.='<td colspan="'.$r.'"></td>';} $Str='</tr></table>'; return $Str; } $Folderpath='path to the folder containing your pictures'; //basolute or relative to the current PHP script $Picturearray=GetPictures($Folderpath); $TableStr=CreateTableString($Picturearray, $Folderpath); // this is your thumbnails table string Does not matter how many pictures you have. The only restriction is the correlation between the tumbnail and the full-size picture names. I hope this will helps.
-
Passing and receiving url variables
onepixel replied to Stevis2002's topic in Editor Help (PhpStorm, VS Code, etc)
Your url should be : [a href=\"http://sdrgrestg.com/view.php?id=n\" target=\"_blank\"]http://sdrgrestg.com/view.php?id=n[/a] instead otherwise the variable passed will be "=n" intead of just "n" Hope this helps -
How about SELECT * FROM test where (test1 = 'Y' OR test 2 = 'N') AND testname = 'MINE'
-
The quickest way to get your site listed in majot search engines (SE) is have as many web sites with high Page Rank (PR) link to your site. High PR site are crwaled very often by SE and they will folow a link to your web site from any other site linking back to you. Besides indexing your site faster, it can boost your web page PR. In the meantime, optimize your web pages: make them SE friendly, add good content, update regularly and add fresh content very often. If you feed SE with "fresh food" they will come back.
-
One solution: <input type="submit" value="Your Caption here">
-
[!--quoteo(post=365428:date=Apr 16 2006, 09:19 PM:name=coldkill)--][div class=\'quotetop\']QUOTE(coldkill @ Apr 16 2006, 09:19 PM) [snapback]365428[/snapback][/div][div class=\'quotemain\'][!--quotec--] OK. [a href=\"http://www.assault-airlift.com/beta/\" target=\"_blank\"]here[/a] is a link to the page. It is in beta so nothing really works at the moment just getting the layout in order. [/quote] Allow me to add my littel input, maybe that will help. To align your page on the screen, first start with the bigger box which is the body tag. Apply to it the [i]text-align:center [/i] and let's see what happens; Of course the other boxes should have position:relative; Let me know!
-
how to link listbox in dreamweaver?
onepixel replied to lanny's topic in Editor Help (PhpStorm, VS Code, etc)
[!--quoteo(post=367867:date=Apr 24 2006, 01:12 AM:name=lanny)--][div class=\'quotetop\']QUOTE(lanny @ Apr 24 2006, 01:12 AM) [snapback]367867[/snapback][/div][div class=\'quotemain\'][!--quotec--] i'm using listbox for user to select the picture they want to display on a particular frame of the web page..i'm using xhtml as the web page and php, mysql. any solutions for that? thanks in advance! [/quote] Javascript, PHP, MySQL One solution will be to use javascript to extract the value (imageid) of the selected item in the list box, append it the the PHP url to be opened in the target frame: parent.framename.location="phpfilename.php?img="+imgid The PHP script will extract the image information for the MySQL database using imgid, then create an html string to display the picture