-
Posts
4,362 -
Joined
-
Last visited
-
Days Won
11
Posts posted by Zane
-
-
The most blunt question is.. "What would you like to see on the page"...
so you can rule out what will be script and what you really have to worry about...what's being displayed
If they can't answer then ask What they're offering on the site....that's so special they need a site.
It's pretty much winging it anyway you go
but sometimes the dumbest questions in your perspective turn out to give the best answers....
I always bring a paper and pencil with me to map out where certain things could go.....in front of them
Good Luck
PS...this isn't a PHP question, I'm moving it to the Misc forum
please watch where you post -
you can use the parse_str function to separate all you're vars if I think that's what you want to do
[code]print_r(parse_str($_SERVER['REQUEST_URI']));[/code] -
somewhere in your equip_list.php file
you are telling it to do something like this I assume
[code]$sql = "SELECT * FROM sometable WHERE subcat = '" . $_GET['subcat'] . "'";[/code]
you need to have it do this instead
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]$sql = "SELECT * FROM sometable WHERE subcat [b]LIKE [/b]'" . $_GET['subcat'] . "'";[/quote]
so just change you link to go to
[a href=\"http://www.rcubed.com/equip_list.php?item_code=SONIC&sub_cat=app%\" target=\"_blank\"]http://www.rcubed.com/equip_list.php?item_...IC&sub_cat=app%[/a]
after you have changed your PHP script
-
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Also the code is really long and i need to add about 8x more stuff in so i was wondering if anyone could shorten it a bit please.[/quote]
you can't just post code and ask us to fix it up for you....
you need to shorten it yourself and then explain what you need help on
and FYI your problem is that you're putting the row for NAME PRICE etc inside your while loop
start the table first then put the while loop
and end the table after the loop -
you're topics being moved to the CSS Forum
-
hmm....learn something everyday
well I guess you'd have to do this then wolves
[code]
class foo {
public $string = foo::bar();
public function __construct($str = $this->string) {
echo $str;
}
public static function bar() {
return "hello";
}
}[/code]
notice it's still static -
how are you sending the Search to the URL first of all
and secondly what code are you using to Search from the url
helps more if you provide some code
my guess is that when you are searching from what's shown in the URL
you're assuming subcat is always equal to it's value
it that's the problem you should have it look at the value.....(likeapp%)...first and then
tell it to say.....
WHERE subcat LIKE 'app%'
instead of
WHERE subcat = 'likeapp%'
LIKE works just as good as equals...especially when you're going to be using wildcards -
I would think that would work at first glance, but class integration with a regular PHP file is kinda hectic anyway
I would say if it doesn't work, you could *grits teeth* make it global
most of the time it's not a good idea to make things global but if it works it works
and the best alternative I could think of would be to make the function bar just a static method in your class
but that just depends on how much bar() has to do with the class at all
see example
[code]
class foo {
public function __construct($str = foo::bar()) {
echo $str;
}
public static function bar() {
return "hello";
}
}[/code]
[!--quoteo(post=362550:date=Apr 7 2006, 11:29 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Apr 7 2006, 11:29 AM) [snapback]362550[/snapback][/div][div class=\'quotemain\'][!--quotec--]
You cannot call a function when when using parameters.
[/quote]
are you sure....I've never ran into such a problem as what wolves is doing
but I would think that you could very well use a function to declare an argument value
it works for any other function
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
echo date("g:m", [!--coloro:#FF6600--][span style=\"color:#FF6600\"][!--/coloro--]strtotime()[!--colorc--][/span][!--/colorc--])
[/quote]
but maybe classes are a different story I dunno...I'm not on my own machine -
on your input boxes..the HTML part
change the name of each box to something like whatever[]...note the brackets
the when the form is sent you'll have a 0 to 15 list of all the input in an array called whatever
[code]A<input name='stuff[]' type='text'>
B<input name='stuff[]' type='text'>
C<input name='stuff[]' type='text'>
D<input name='stuff[]' type='text'>
//$stuff[2] would be the C one
[/code]
anyway...once you do that...do a foreach loop with it
to make sure each one is unique
and if it is just continue
if not.....stop everything I guess and throw your error
say
[code]foreach($stuff as $val) [
if(in_array($val, $stuff))
die("ERROR");
}[/code] -
Yes, you can do this
Same script but modified
[code]function loop_thing(){
//sql query stuff here
$results = array();
$i = 0;
while($row = mysql_fetch_array($sql_r, MYSQL_NUM)){
$results[] = $row[$i];
}
return $results;
}
//then to output:
$results = loop_thing();
echo $result[0]. "<br>";
echo $result[1]. "<br>";
echo $result[2];
[/code] -
the header function has to be used before ANY output to the browser
and all this is output
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<p> </p>
<form name="form1" method="post" action="">
<p>login (email):
<input type="text" name="em">
<input name="pass1" type="password">
<input name="submitf" type="submit">
<input name="resetf" type="reset">
</p>
</form>
<p> </p>[/quote]
I'm surprised you're not getting a "Cannot modify header" error -
use the is_null() function
[code]if(is_null($var) || is_null($anotherVar))[/code] -
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]I was wondering how you guys made the code block[/quote]
well...we didn't make it first of all
and most likely regex was used to do it
all it is is it replaces stuff between [code] with a formatted div tag
whilst removing the code tag
and then they CSS to make it look prettier -
This could work as well
it will delete every key that has a matching one in the other table...leaving the 'unrelated' ones
as I assume you wanted
[code]
DELETE FROM cvs, jscvs USING cvs, jscvs WHERE cvs.id = jscvs.id;[/code] -
go to [a href=\"http://php.net/addslashes\" target=\"_blank\"]http://php.net/addslashes[/a]
and learn the function
it should fix it all up -
I wonder if this works...try it
[code]strtotime("7 hours 30 minutes", strtotime("8:30"));[/code] -
I bet the message is parsed before it's added to the database and the PHP parts were just formated beforehand using regex or something, that would explain why the quote tags from way back are different too
see check it out
[a href=\"http://www.phpfreaks.com/forums/index.php?s=&showtopic=34590&view=findpost&p=126084\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...ndpost&p=126084[/a]
-
could you just convert it to UNIX timestamp and do a couple date/time functions
[code]date("g:i", strtotime("8:30 + 7 hours 30 minutes"));[/code] -
[!--quoteo(post=360123:date=Mar 30 2006, 02:44 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Mar 30 2006, 02:44 PM) [snapback]360123[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Please tell me that this is all generated from the same page and you just want to look at the status of a field in a database of all your users.
[/quote]
I think, no I'm pretty sure that he's trying to phish data from a database he doesn't have access to.
[!--quoteo(post=360123:date=Mar 30 2006, 02:44 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Mar 30 2006, 02:44 PM) [snapback]360123[/snapback][/div][div class=\'quotemain\'][!--quotec--]Otherwise, that's gotta be the worst design of a website I've ever heard of.
[/quote]
These forums are laid out such a way.....for instance, the 'newbies'. 'lurkers', and 'gurus' all have a significant field value on their profile...wouldn't be too hard to just do a loop, but it would take such a long time
-
you would need to look into these two function
ereg()
file_get_contents()
assuming you know how many users there are, you'd create a loop from 1 to that number using a counter var
and have it ereg each page for that gif
using the counter var again
something like this
[code]
$parseUrl = "http://www.example.com/member/profile/";
$numUsers = 0;
for($i=0; $i<5000; $i++) {
$parsePage = file_get_contents($parseUrl$i);
if(ereg("http://www.example.com/images/powermember.gif", $parsePage))
$numUsers++;
}
echo "There are " . $numUsers . " power users";[/code]
EDIT
But using something like that would take FOREVER if there are a lot of pages -
if you're wanting to perform it when on hover
you should use onMouseOver instead of MouseOut
and also on your script
[code]function tagHelp(name, usage){
eval("window.document.form."+name+".value = Usage: usage;");
}[/code]
usage should be outside the quotes the same as name
like so
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]function tagHelp(name, usage){
eval("window.document.form."+name+".value = Usage:[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--][b]"+usage+"[/b][!--colorc--][/span][!--/colorc--];");
}[/quote]
and if I'm not mistaken you should have to put single quotes around the new value
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]function tagHelp(name, usage){
eval("window.document.form."+name+".value = [!--coloro:#3366FF--][span style=\"color:#3366FF\"][!--/coloro--]'Usage:"+usage+"'[!--colorc--][/span][!--/colorc--];");
}[/quote] -
if that's the exact format of the email then this may work
[code]
(v|V)<span.*</span>(i|I)<span.*</span>(a|A)<span.*</span>(g|G)<span.*</span>(r|R)<span.*</span>(a|A)</font>[/code]
can't guarentee anything though -
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]I want the user to be able to click on a button located within the form and be took to a seperate page[/quote]
are you talking about having two separate submit buttons?
I couldn't think of any reason to have a nested form, seems kinda redundant....only reason I could think of is if you wanted to make a certain field mandatory which can be done with a CGI/Javascript anyway. -
if you use the key SCRIPT_FILENAME on $_SERVER
you'll get just the filename
[code]$fname = $_SERVER['SCRIPT_FILENAME'];[/code]
dw not connecting verify url prefix
in Editor Help (PhpStorm, VS Code, etc)
Posted
a testing server is for when you are publishing to a remote server
you create a testing server that is....hopefully...identical in it's settings....so you know [b]before[/b] you publish it if it will work
but since you're doing it on localhost
you just need to tell it where you're local files are
and just...forget about the testing server or cloaking server or anything else besides your local files.